Skip to content

tests: fix class-scoped fixtures defined as instance methods - #1218

Open
polkorny wants to merge 1 commit into
python-openapi:masterfrom
polkorny:master
Open

tests: fix class-scoped fixtures defined as instance methods#1218
polkorny wants to merge 1 commit into
python-openapi:masterfrom
polkorny:master

Conversation

@polkorny

Copy link
Copy Markdown

pytest 9.1 deprecates class-scoped fixtures defined as plain
instance methods (PytestRemovedIn10Warning): attributes set on
self in the fixture aren't visible to test methods, since pytest
creates a new instance per test but runs the fixture only once per
class.

Convert the spec/content/finder fixtures in
test_media_types_finders.py and the spec/responses/finder
fixtures in test_responses_finders.py to @classmethod, per
https://docs.pytest.org/en/stable/deprecations.html#class-scoped-fixture-as-instance-method

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.

1 participant