make PytestReturnNotNoneWarning a RemovedIn8Warning by removing the `@final` decorator

This commit is contained in:
Thomas Grainger 2022-08-08 10:23:26 +01:00
parent 58cf20edf0
commit a980ac08dd
No known key found for this signature in database
GPG Key ID: DDA48B5C47FBC8C8
2 changed files with 10 additions and 2 deletions

View File

@ -342,6 +342,12 @@ else:
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):
from functools import cached_property as cached_property
else:

View File

@ -6,6 +6,7 @@ from typing import TypeVar
import attr
from _pytest.compat import final
from _pytest.compat import sealed
class PytestWarning(UserWarning):
@ -48,14 +49,15 @@ class PytestDeprecationWarning(PytestWarning, DeprecationWarning):
__module__ = "pytest"
@final
@sealed
class PytestRemovedIn8Warning(PytestDeprecationWarning):
"""Warning class for features that will be removed in pytest 8."""
__module__ = "pytest"
class PytestReturnNotNoneWarning(PytestDeprecationWarning):
@sealed
class PytestReturnNotNoneWarning(PytestRemovedIn8Warning):
"""Warning emitted when a test function is returning value other than None."""
__module__ = "pytest"