make PytestReturnNotNoneWarning a RemovedIn8Warning by removing the `@final` decorator
This commit is contained in:
parent
58cf20edf0
commit
a980ac08dd
|
@ -342,6 +342,12 @@ else:
|
||||||
return f
|
return f
|
||||||
|
|
||||||
|
|
||||||
|
# TODO: sealed classes are not supported yet
|
||||||
|
# https://github.com/mypyc/mypyc/issues/846
|
||||||
|
def sealed(f: _T) -> _T:
|
||||||
|
return f
|
||||||
|
|
||||||
|
|
||||||
if sys.version_info >= (3, 8):
|
if sys.version_info >= (3, 8):
|
||||||
from functools import cached_property as cached_property
|
from functools import cached_property as cached_property
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -6,6 +6,7 @@ from typing import TypeVar
|
||||||
import attr
|
import attr
|
||||||
|
|
||||||
from _pytest.compat import final
|
from _pytest.compat import final
|
||||||
|
from _pytest.compat import sealed
|
||||||
|
|
||||||
|
|
||||||
class PytestWarning(UserWarning):
|
class PytestWarning(UserWarning):
|
||||||
|
@ -48,14 +49,15 @@ class PytestDeprecationWarning(PytestWarning, DeprecationWarning):
|
||||||
__module__ = "pytest"
|
__module__ = "pytest"
|
||||||
|
|
||||||
|
|
||||||
@final
|
@sealed
|
||||||
class PytestRemovedIn8Warning(PytestDeprecationWarning):
|
class PytestRemovedIn8Warning(PytestDeprecationWarning):
|
||||||
"""Warning class for features that will be removed in pytest 8."""
|
"""Warning class for features that will be removed in pytest 8."""
|
||||||
|
|
||||||
__module__ = "pytest"
|
__module__ = "pytest"
|
||||||
|
|
||||||
|
|
||||||
class PytestReturnNotNoneWarning(PytestDeprecationWarning):
|
@sealed
|
||||||
|
class PytestReturnNotNoneWarning(PytestRemovedIn8Warning):
|
||||||
"""Warning emitted when a test function is returning value other than None."""
|
"""Warning emitted when a test function is returning value other than None."""
|
||||||
|
|
||||||
__module__ = "pytest"
|
__module__ = "pytest"
|
||||||
|
|
Loading…
Reference in New Issue