Skip to content

Commit 1b7896f

Browse files
committed
Add PytestRemovedIn9Warning
It's good to have it available already in all 8.* versions, even if it's not used yet.
1 parent a4a189a commit 1b7896f

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

doc/en/reference/reference.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,9 @@ Custom warnings generated in some situations such as improper usage or deprecate
11531153
.. autoclass:: pytest.PytestRemovedIn8Warning
11541154
:show-inheritance:
11551155

1156+
.. autoclass:: pytest.PytestRemovedIn9Warning
1157+
:show-inheritance:
1158+
11561159
.. autoclass:: pytest.PytestUnhandledCoroutineWarning
11571160
:show-inheritance:
11581161

src/_pytest/warning_types.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ class PytestRemovedIn8Warning(PytestDeprecationWarning):
5656
__module__ = "pytest"
5757

5858

59+
class PytestRemovedIn9Warning(PytestDeprecationWarning):
60+
"""Warning class for features that will be removed in pytest 9."""
61+
62+
__module__ = "pytest"
63+
64+
5965
class PytestReturnNotNoneWarning(PytestRemovedIn8Warning):
6066
"""Warning emitted when a test function is returning value other than None."""
6167

src/pytest/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
from _pytest.warning_types import PytestDeprecationWarning
7272
from _pytest.warning_types import PytestExperimentalApiWarning
7373
from _pytest.warning_types import PytestRemovedIn8Warning
74+
from _pytest.warning_types import PytestRemovedIn9Warning
7475
from _pytest.warning_types import PytestReturnNotNoneWarning
7576
from _pytest.warning_types import PytestUnhandledCoroutineWarning
7677
from _pytest.warning_types import PytestUnhandledThreadExceptionWarning
@@ -131,6 +132,7 @@
131132
"PytestDeprecationWarning",
132133
"PytestExperimentalApiWarning",
133134
"PytestRemovedIn8Warning",
135+
"PytestRemovedIn9Warning",
134136
"PytestReturnNotNoneWarning",
135137
"Pytester",
136138
"PytestPluginManager",

0 commit comments

Comments
 (0)