Skip to content

fix: allow per-call context options to override fixture defaults - #355

Merged
Dmitry Gozman (dgozman) merged 4 commits into
microsoft:mainfrom
charles-ycg:fix-new-context-option-overrides
Nov 23, 2026
Merged

Dmitry Gozman (dgozman) merged 4 commits into
microsoft:mainfrom
charles-ycg:fix-new-context-option-overrides

Conversation

@charles-ycg

Copy link
Copy Markdown
Contributor

Summary

  • Merge the context defaults with the arguments passed to new_context(...) in both plugins. Explicit arguments take precedence and do not mutate the defaults.
  • Extend the sync and async regressions to cover two user-agent overrides and a later context that still uses the marker's default.

Validation

  • Ran the two updated pytester regressions against Chrome. Both fail on unchanged main with a duplicate user_agent keyword error and pass with the fix.
  • Ran the sync and async browser context option tests against Chrome. All 10 passed.
  • Black 24.10.0, Flake8 7.1.1, and git diff --check passed on the change.

@charles-ycg

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

@dgozman Dmitry Gozman (dgozman) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR, looks great.

@dgozman
Dmitry Gozman (dgozman) merged commit b4cd041 into microsoft:main Nov 23, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants