diff --git a/changelog/2452.removal.rst b/changelog/2452.removal.rst index 3c60f8803..2a2e3f810 100644 --- a/changelog/2452.removal.rst +++ b/changelog/2452.removal.rst @@ -1,2 +1,5 @@ The functions ``Node.warn`` and ``Config.warn`` have been deprecated. Instead of ``Node.warn`` users should now use ``Node.std_warn``, while ``Config.warn`` should be replaced by the standard ``warnings.warn``. + +``RemovedInPytest4Warning`` and ``PytestExperimentalApiWarning`` are now part of the public API and should be accessed +using ``pytest.RemovedInPytest4Warning`` and ``pytest.PytestExperimentalApiWarning``. diff --git a/doc/en/warnings.rst b/doc/en/warnings.rst index 6db100fd7..89d064f16 100644 --- a/doc/en/warnings.rst +++ b/doc/en/warnings.rst @@ -378,5 +378,5 @@ The following warning types ares used by pytest and are part of the public API: .. autoclass:: pytest.RemovedInPytest4Warning -.. autoclass:: pytest.PytestExerimentalApiWarning +.. autoclass:: pytest.PytestExperimentalApiWarning diff --git a/doc/en/writing_plugins.rst b/doc/en/writing_plugins.rst index 27e13d932..03bad31be 100644 --- a/doc/en/writing_plugins.rst +++ b/doc/en/writing_plugins.rst @@ -419,7 +419,7 @@ additionally it is possible to copy examples for a example folder before running ============================= warnings summary ============================= test_example.py::test_plugin - $REGENDOC_TMPDIR/test_example.py:4: PytestExerimentalApiWarning: testdir.copy_example is an experimental api that may change over time + $REGENDOC_TMPDIR/test_example.py:4: PytestExperimentalApiWarning: testdir.copy_example is an experimental api that may change over time testdir.copy_example("test_example.py") -- Docs: https://docs.pytest.org/en/latest/warnings.html diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index ea0ccf136..4140dfc50 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -645,7 +645,7 @@ class Testdir(object): import warnings warnings.warn( - pytest.PytestExerimentalApiWarning.simple("testdir.copy_example"), + pytest.PytestExperimentalApiWarning.simple("testdir.copy_example"), stacklevel=2, ) example_dir = self.request.config.getini("pytester_example_dir") diff --git a/src/_pytest/warning_types.py b/src/_pytest/warning_types.py index 407cfb100..4422363b1 100644 --- a/src/_pytest/warning_types.py +++ b/src/_pytest/warning_types.py @@ -22,7 +22,7 @@ class RemovedInPytest4Warning(PytestDeprecationWarning): """ -class PytestExerimentalApiWarning(PytestWarning, FutureWarning): +class PytestExperimentalApiWarning(PytestWarning, FutureWarning): """ Bases: :class:`pytest.PytestWarning`, :class:`FutureWarning`. diff --git a/src/pytest.py b/src/pytest.py index e29e6116e..e173fd3d4 100644 --- a/src/pytest.py +++ b/src/pytest.py @@ -24,7 +24,7 @@ from _pytest.warning_types import ( PytestWarning, PytestDeprecationWarning, RemovedInPytest4Warning, - PytestExerimentalApiWarning, + PytestExperimentalApiWarning, ) set_trace = __pytestPDB.set_trace @@ -55,7 +55,7 @@ __all__ = [ "Package", "param", "PytestDeprecationWarning", - "PytestExerimentalApiWarning", + "PytestExperimentalApiWarning", "PytestWarning", "raises", "register_assert_rewrite", diff --git a/tox.ini b/tox.ini index a071b5bf4..0b6e89aa6 100644 --- a/tox.ini +++ b/tox.ini @@ -230,7 +230,7 @@ filterwarnings = # produced by python >=3.5 on execnet (pytest-xdist) ignore:.*inspect.getargspec.*deprecated, use inspect.signature.*:DeprecationWarning # pytest's own futurewarnings - ignore::pytest.PytestExerimentalApiWarning + ignore::pytest.PytestExperimentalApiWarning pytester_example_dir = testing/example_scripts [flake8] max-line-length = 120