Skip to content

Fix base_url fallback fixture deprecation with pytest 9.2 - #343

Closed
Michel (md-info) wants to merge 1 commit into
microsoft:mainfrom
md-info:fix/341-base-url-fixture
Closed

Michel (md-info) wants to merge 1 commit into
microsoft:mainfrom
md-info:fix/341-base-url-fixture

Conversation

@md-info

Copy link
Copy Markdown

When pytest-base-url is absent, requesting the fallback base_url fixture on pytest 9.2 emits PytestRemovedIn10Warning. Projects treating this warning as an error cannot set up the page fixture.

Make the fallback fixture a static method in both the sync and async plugins. Extend the existing base URL tests to treat this specific warning as an error, preserving coverage for command-line, ini, environment, and unset values without failing on unrelated plugin warnings.

Fixes #341.

Validation:

  • Python 3.12, pytest 9.2.0, Playwright 1.64.1, pytest-asyncio 1.3.0, Chromium: all 8 targeted sync/async cases passed without pytest-base-url installed.
  • Verified the option case in each plugin fails against the original implementation with the exact fixture deprecation warning.
  • Black 24.10.0, Flake8 7.1.1, and git diff --check passed for the changed files.
  • Mypy 1.13.0 reports the same 8 errors on both unchanged upstream and this patch in this environment.
  • The full cross-platform suite was not run locally.

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.

PytestRemovedIn10Warning for base_url with pytest 9.2.0 and pytest-playwright 0.10.0 without pytest-base-url

2 participants