Skip to content

Commit a71a95b

Browse files
committed
Change "Marks applied to fixtures" removal from 8 to 9
The deprecation has only been added in 8.0, so can't be removed in 8. That will have to wait for 9.
1 parent acd445a commit a71a95b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/_pytest/deprecated.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
from _pytest.warning_types import PytestDeprecationWarning
1414
from _pytest.warning_types import PytestRemovedIn8Warning
15+
from _pytest.warning_types import PytestRemovedIn9Warning
1516
from _pytest.warning_types import UnformattedWarning
1617

1718
# set of plugins which have been integrated into the core; we use this list to ignore
@@ -122,7 +123,7 @@
122123
"#configuring-hook-specs-impls-using-markers",
123124
)
124125

125-
MARKED_FIXTURE = PytestRemovedIn8Warning(
126+
MARKED_FIXTURE = PytestRemovedIn9Warning(
126127
"Marks applied to fixtures have no effect\n"
127128
"See docs: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function"
128129
)

testing/deprecated_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ def test_importing_instance_is_deprecated(pytester: Pytester) -> None:
290290
def test_fixture_disallow_on_marked_functions():
291291
"""Test that applying @pytest.fixture to a marked function warns (#3364)."""
292292
with pytest.warns(
293-
pytest.PytestRemovedIn8Warning,
293+
pytest.PytestRemovedIn9Warning,
294294
match=r"Marks applied to fixtures have no effect",
295295
) as record:
296296

@@ -309,7 +309,7 @@ def foo():
309309
def test_fixture_disallow_marks_on_fixtures():
310310
"""Test that applying a mark to a fixture warns (#3364)."""
311311
with pytest.warns(
312-
pytest.PytestRemovedIn8Warning,
312+
pytest.PytestRemovedIn9Warning,
313313
match=r"Marks applied to fixtures have no effect",
314314
) as record:
315315

@@ -325,7 +325,7 @@ def foo():
325325
def test_fixture_disallowed_between_marks():
326326
"""Test that applying a mark to a fixture warns (#3364)."""
327327
with pytest.warns(
328-
pytest.PytestRemovedIn8Warning,
328+
pytest.PytestRemovedIn9Warning,
329329
match=r"Marks applied to fixtures have no effect",
330330
) as record:
331331

0 commit comments

Comments
 (0)