Repository navigation
fix: define the fallback base_url fixture at module level - #345
Merged
Pavel Feldman (pavelfeldman) merged 1 commit intoNov 3, 2026
Merged
Conversation
pytest 9.2 deprecates session-scoped fixtures defined as instance methods. The base_url fallback used when pytest-base-url is not in use was one, so every test using the page fixture reported a PytestRemovedIn10Warning. Move the fixture into a module and register that instead of a class instance, in both plugins. Fixes #341.
Yury Semikhatsky (yury-s)
approved these changes
Nov 3, 2026
Pavel Feldman (pavelfeldman)
deleted the
fix-341-base-url-fixture-deprecation
branch
November 3, 2026 23:15
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.
Fixes #341.
pytest 9.2 deprecates session-scoped fixtures defined as instance methods (
PytestRemovedIn10Warning). Thebase_urlfallback that the plugin registers when pytest-base-url is not in use was an instance of_BaseUrlFallbackwith abase_urlmethod, so every test usingpagereported the warning and errored under-W error::pytest.PytestRemovedIn10Warning. With pytest-base-url loaded the fallback is never registered, which is why those setups were unaffected.The fixture now lives in a module,
_base_url_fallback.py, and the plugin registers the module instead of an instance. Same change in pytest-playwright-asyncio.Tests
test_base_url_without_pytest_base_urlnow asserts that the inner run reports no warnings; it fails on the previous code with pytest 9.2.0. The issue's repro was verified from a built wheel in a bare venv without pytest-base-url, on pytest 9.2.0 (no warning, and passing with the warning turned into an error) and on pytest 8.4.2.