Repository navigation
feat: allow per-test browser launch options via indirect parametrization - #329
Merged
Merged
Conversation
Pavel Feldman (pavelfeldman)
added this pull request to stack #335
October 7, 2026 23:05
Yury Semikhatsky (yury-s)
approved these changes
Oct 8, 2026
Pavel Feldman (pavelfeldman)
force-pushed
the
feat-205-launch-args-param
branch
from
October 8, 2026 01:32
c61dc17 to
dd40278
Compare
@pytest.mark.parametrize("browser_type_launch_args", [{...}], indirect=True)
used to be silently ignored by the built-in fixture. Merge request.param into
the launch options; pytest relaunches the session browser per distinct value.
Fixes #205
Pavel Feldman (pavelfeldman)
force-pushed
the
feat-205-launch-args-param
branch
from
October 8, 2026 01:42
dd40278 to
0173470
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@pytest.mark.parametrize("browser_type_launch_args", [{...}], indirect=True)was silently ignored by the built-in fixture. It now mergesrequest.paraminto the launch options, on top of the command line options (--headed,--browser-channel,--slowmo). The fixture is session scoped, so pytest relaunches the browser for each distinct value and groups the tests accordingly. A value that is not a mapping raisespytest.UsageErrornaming the fixture instead of failing insidedict.update.Tests: two parametrized user agents plus an unparametrized test in one run, and the error for a non-mapping value (sync + async).
Docs follow-up (microsoft/playwright
docs/src/test-runners-python.md): document the parametrization and that each distinct value launches its own browser.Fixes #205
Stack created with GitHub Stacks CLI • Give Feedback 💬