Merge pull request #11745 from bluetech/change-marked-fixture-removal

Change "Marks applied to fixtures" removal from 8 to 9
This commit is contained in:
Ran Benita 2023-12-31 10:10:20 +02:00 committed by GitHub
commit 640f84a5aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -12,6 +12,7 @@ from warnings import warn
from _pytest.warning_types import PytestDeprecationWarning
from _pytest.warning_types import PytestRemovedIn8Warning
from _pytest.warning_types import PytestRemovedIn9Warning
from _pytest.warning_types import UnformattedWarning
# set of plugins which have been integrated into the core; we use this list to ignore
@ -122,7 +123,7 @@ HOOK_LEGACY_MARKING = UnformattedWarning(
"#configuring-hook-specs-impls-using-markers",
)
MARKED_FIXTURE = PytestRemovedIn8Warning(
MARKED_FIXTURE = PytestRemovedIn9Warning(
"Marks applied to fixtures have no effect\n"
"See docs: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function"
)

View File

@ -290,7 +290,7 @@ def test_importing_instance_is_deprecated(pytester: Pytester) -> None:
def test_fixture_disallow_on_marked_functions():
"""Test that applying @pytest.fixture to a marked function warns (#3364)."""
with pytest.warns(
pytest.PytestRemovedIn8Warning,
pytest.PytestRemovedIn9Warning,
match=r"Marks applied to fixtures have no effect",
) as record:
@ -309,7 +309,7 @@ def test_fixture_disallow_on_marked_functions():
def test_fixture_disallow_marks_on_fixtures():
"""Test that applying a mark to a fixture warns (#3364)."""
with pytest.warns(
pytest.PytestRemovedIn8Warning,
pytest.PytestRemovedIn9Warning,
match=r"Marks applied to fixtures have no effect",
) as record:
@ -325,7 +325,7 @@ def test_fixture_disallow_marks_on_fixtures():
def test_fixture_disallowed_between_marks():
"""Test that applying a mark to a fixture warns (#3364)."""
with pytest.warns(
pytest.PytestRemovedIn8Warning,
pytest.PytestRemovedIn9Warning,
match=r"Marks applied to fixtures have no effect",
) as record: