Add docs for internal warnings and introduce PytestDeprecationWarning

Fix #2477
This commit is contained in:
Bruno Oliveira
2018-09-03 13:36:12 -03:00
parent 19a01c9849
commit 208dd3aad1
3 changed files with 74 additions and 4 deletions

View File

@@ -1,6 +1,22 @@
class PytestWarning(UserWarning):
"""Base class for all warnings emitted by pytest"""
"""
Bases: :class:`UserWarning`.
Base class for all warnings emitted by pytest.
"""
class RemovedInPytest4Warning(PytestWarning, DeprecationWarning):
"""warning class for features that will be removed in pytest 4.0"""
class PytestDeprecationWarning(PytestWarning, DeprecationWarning):
"""
Bases: :class:`pytest.PytestWarning`, :class:`DeprecationWarning`.
Warning class for features that will be removed in a future version.
"""
class RemovedInPytest4Warning(PytestDeprecationWarning):
"""
Bases: :class:`pytest.PytestDeprecationWarning`.
Warning class for features scheduled to be removed in pytest 4.0.
"""

View File

@@ -20,7 +20,11 @@ from _pytest.nodes import Item, Collector, File
from _pytest.fixtures import fillfixtures as _fillfuncargs
from _pytest.python import Package, Module, Class, Instance, Function, Generator
from _pytest.python_api import approx, raises
from _pytest.warning_types import PytestWarning, RemovedInPytest4Warning
from _pytest.warning_types import (
PytestWarning,
PytestDeprecationWarning,
RemovedInPytest4Warning,
)
set_trace = __pytestPDB.set_trace
@@ -50,6 +54,7 @@ __all__ = [
"Package",
"param",
"PytestWarning",
"PytestDeprecationWarning",
"raises",
"register_assert_rewrite",
"RemovedInPytest4Warning",