Publish UnknownMarkWarning as part of the public API and docs
This commit is contained in:
parent
ebc0cea226
commit
8532e991a5
|
@ -420,3 +420,5 @@ The following warning types ares used by pytest and are part of the public API:
|
|||
.. autoclass:: pytest.RemovedInPytest4Warning
|
||||
|
||||
.. autoclass:: pytest.PytestExperimentalApiWarning
|
||||
|
||||
.. autoclass:: pytest.PytestUnknownMarkWarning
|
||||
|
|
|
@ -12,7 +12,7 @@ from ..compat import MappingMixin
|
|||
from ..compat import NOTSET
|
||||
from _pytest.deprecated import PYTEST_PARAM_UNKNOWN_KWARGS
|
||||
from _pytest.outcomes import fail
|
||||
from _pytest.warning_types import UnknownMarkWarning
|
||||
from _pytest.warning_types import PytestUnknownMarkWarning
|
||||
|
||||
EMPTY_PARAMETERSET_OPTION = "empty_parameter_set_mark"
|
||||
|
||||
|
@ -318,7 +318,7 @@ class MarkGenerator(object):
|
|||
"Unknown pytest.mark.%s - is this a typo? You can register "
|
||||
"custom marks to avoid this warning - for details, see "
|
||||
"https://docs.pytest.org/en/latest/mark.html" % name,
|
||||
UnknownMarkWarning,
|
||||
PytestUnknownMarkWarning,
|
||||
)
|
||||
|
||||
return MarkDecorator(Mark(name, (), {}))
|
||||
|
|
|
@ -9,7 +9,7 @@ class PytestWarning(UserWarning):
|
|||
"""
|
||||
|
||||
|
||||
class UnknownMarkWarning(PytestWarning):
|
||||
class PytestUnknownMarkWarning(PytestWarning):
|
||||
"""
|
||||
Bases: :class:`PytestWarning`.
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ from _pytest.recwarn import deprecated_call
|
|||
from _pytest.recwarn import warns
|
||||
from _pytest.warning_types import PytestDeprecationWarning
|
||||
from _pytest.warning_types import PytestExperimentalApiWarning
|
||||
from _pytest.warning_types import PytestUnknownMarkWarning
|
||||
from _pytest.warning_types import PytestWarning
|
||||
from _pytest.warning_types import RemovedInPytest4Warning
|
||||
|
||||
|
@ -72,6 +73,7 @@ __all__ = [
|
|||
"raises",
|
||||
"register_assert_rewrite",
|
||||
"RemovedInPytest4Warning",
|
||||
"PytestUnknownMarkWarning",
|
||||
"Session",
|
||||
"set_trace",
|
||||
"skip",
|
||||
|
|
2
tox.ini
2
tox.ini
|
@ -169,7 +169,7 @@ filterwarnings =
|
|||
# Do not cause SyntaxError for invalid escape sequences in py37.
|
||||
default:invalid escape sequence:DeprecationWarning
|
||||
# ignore use of unregistered marks, because we use many to test the implementation
|
||||
ignore::_pytest.warning_types.UnknownMarkWarning
|
||||
ignore::_pytest.warning_types.PytestUnknownMarkWarning
|
||||
pytester_example_dir = testing/example_scripts
|
||||
markers =
|
||||
issue
|
||||
|
|
Loading…
Reference in New Issue