Skip to content

Change "Marks applied to fixtures" removal from 8 to 9 #11745

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/_pytest/deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

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
Expand Down Expand Up @@ -122,7 +123,7 @@
"#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"
)
Expand Down
6 changes: 3 additions & 3 deletions testing/deprecated_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -309,7 +309,7 @@ def foo():
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:

Expand All @@ -325,7 +325,7 @@ def foo():
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:

Expand Down