Skip to content

Commit 90d5433

Browse files
committed
Move warnings listing to reference docs
1 parent d134e76 commit 90d5433

File tree

3 files changed

+40
-34
lines changed

3 files changed

+40
-34
lines changed

doc/en/reference.rst

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,10 +1021,45 @@ When set (regardless of value), pytest will use color in terminal output.
10211021
Exceptions
10221022
----------
10231023

1024-
UsageError
1025-
~~~~~~~~~~
1026-
10271024
.. autoclass:: _pytest.config.UsageError()
1025+
:show-inheritance:
1026+
1027+
.. _`warnings ref`:
1028+
1029+
Warnings
1030+
--------
1031+
1032+
Custom warnings generated in some situations such as improper usage or deprecated features.
1033+
1034+
.. autoclass:: pytest.PytestWarning
1035+
:show-inheritance:
1036+
1037+
.. autoclass:: pytest.PytestAssertRewriteWarning
1038+
:show-inheritance:
1039+
1040+
.. autoclass:: pytest.PytestCacheWarning
1041+
:show-inheritance:
1042+
1043+
.. autoclass:: pytest.PytestCollectionWarning
1044+
:show-inheritance:
1045+
1046+
.. autoclass:: pytest.PytestConfigWarning
1047+
:show-inheritance:
1048+
1049+
.. autoclass:: pytest.PytestDeprecationWarning
1050+
:show-inheritance:
1051+
1052+
.. autoclass:: pytest.PytestExperimentalApiWarning
1053+
:show-inheritance:
1054+
1055+
.. autoclass:: pytest.PytestUnhandledCoroutineWarning
1056+
:show-inheritance:
1057+
1058+
.. autoclass:: pytest.PytestUnknownMarkWarning
1059+
:show-inheritance:
1060+
1061+
1062+
Consult the :ref:`internal-warnings` section in the documentation for more information.
10281063

10291064

10301065
.. _`ini options ref`:

doc/en/warnings.rst

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,6 @@ custom error message.
381381
Internal pytest warnings
382382
------------------------
383383

384-
385-
386384
pytest may generate its own warnings in some situations, such as improper usage or deprecated features.
387385

388386
For example, pytest will emit a warning if it encounters a class that matches :confval:`python_classes` but also
@@ -415,31 +413,4 @@ These warnings might be filtered using the same builtin mechanisms used to filte
415413
Please read our :ref:`backwards-compatibility` to learn how we proceed about deprecating and eventually removing
416414
features.
417415

418-
The following warning types are used by pytest and are part of the public API:
419-
420-
.. autoclass:: pytest.PytestWarning
421-
:show-inheritance:
422-
423-
.. autoclass:: pytest.PytestAssertRewriteWarning
424-
:show-inheritance:
425-
426-
.. autoclass:: pytest.PytestCacheWarning
427-
:show-inheritance:
428-
429-
.. autoclass:: pytest.PytestCollectionWarning
430-
:show-inheritance:
431-
432-
.. autoclass:: pytest.PytestConfigWarning
433-
:show-inheritance:
434-
435-
.. autoclass:: pytest.PytestDeprecationWarning
436-
:show-inheritance:
437-
438-
.. autoclass:: pytest.PytestExperimentalApiWarning
439-
:show-inheritance:
440-
441-
.. autoclass:: pytest.PytestUnhandledCoroutineWarning
442-
:show-inheritance:
443-
444-
.. autoclass:: pytest.PytestUnknownMarkWarning
445-
:show-inheritance:
416+
The full list of warnings is listed in :ref:`the reference documentation <warnings ref>`.

src/_pytest/warning_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class PytestUnhandledCoroutineWarning(PytestWarning):
7878
class PytestUnknownMarkWarning(PytestWarning):
7979
"""Warning emitted on use of unknown markers.
8080
81-
See https://docs.pytest.org/en/stable/mark.html for details.
81+
See :ref:`mark` for details.
8282
"""
8383

8484
__module__ = "pytest"

0 commit comments

Comments
 (0)