doc: use show-inheritance with warnings, revisit docstrings

Revisits the docstring for `PytestExperimentalApiWarning` and
`PytestUnhandledCoroutineWarning`.
This commit is contained in:
Daniel Hahler 2020-03-05 02:56:18 +01:00
parent 1a8d427e98
commit 77adb33ec6
2 changed files with 23 additions and 42 deletions

View File

@ -416,19 +416,28 @@ features.
The following warning types are used by pytest and are part of the public API: The following warning types are used by pytest and are part of the public API:
.. autoclass:: pytest.PytestWarning .. autoclass:: pytest.PytestWarning
:show-inheritance:
.. autoclass:: pytest.PytestAssertRewriteWarning .. autoclass:: pytest.PytestAssertRewriteWarning
:show-inheritance:
.. autoclass:: pytest.PytestCacheWarning .. autoclass:: pytest.PytestCacheWarning
:show-inheritance:
.. autoclass:: pytest.PytestCollectionWarning .. autoclass:: pytest.PytestCollectionWarning
:show-inheritance:
.. autoclass:: pytest.PytestConfigWarning .. autoclass:: pytest.PytestConfigWarning
:show-inheritance:
.. autoclass:: pytest.PytestDeprecationWarning .. autoclass:: pytest.PytestDeprecationWarning
:show-inheritance:
.. autoclass:: pytest.PytestExperimentalApiWarning .. autoclass:: pytest.PytestExperimentalApiWarning
:show-inheritance:
.. autoclass:: pytest.PytestUnhandledCoroutineWarning .. autoclass:: pytest.PytestUnhandledCoroutineWarning
:show-inheritance:
.. autoclass:: pytest.PytestUnknownMarkWarning .. autoclass:: pytest.PytestUnknownMarkWarning
:show-inheritance:

View File

@ -11,71 +11,46 @@ if TYPE_CHECKING:
class PytestWarning(UserWarning): class PytestWarning(UserWarning):
""" """Base class for all warnings emitted by pytest."""
Bases: :class:`UserWarning`.
Base class for all warnings emitted by pytest.
"""
__module__ = "pytest" __module__ = "pytest"
class PytestAssertRewriteWarning(PytestWarning): class PytestAssertRewriteWarning(PytestWarning):
""" """Warning emitted by the pytest assert rewrite module."""
Bases: :class:`PytestWarning`.
Warning emitted by the pytest assert rewrite module.
"""
__module__ = "pytest" __module__ = "pytest"
class PytestCacheWarning(PytestWarning): class PytestCacheWarning(PytestWarning):
""" """Warning emitted by the cache plugin in various situations."""
Bases: :class:`PytestWarning`.
Warning emitted by the cache plugin in various situations.
"""
__module__ = "pytest" __module__ = "pytest"
class PytestConfigWarning(PytestWarning): class PytestConfigWarning(PytestWarning):
""" """Warning emitted for configuration issues."""
Bases: :class:`PytestWarning`.
Warning emitted for configuration issues.
"""
__module__ = "pytest" __module__ = "pytest"
class PytestCollectionWarning(PytestWarning): class PytestCollectionWarning(PytestWarning):
""" """Warning emitted when pytest is not able to collect a file or symbol in a module."""
Bases: :class:`PytestWarning`.
Warning emitted when pytest is not able to collect a file or symbol in a module.
"""
__module__ = "pytest" __module__ = "pytest"
class PytestDeprecationWarning(PytestWarning, DeprecationWarning): class PytestDeprecationWarning(PytestWarning, DeprecationWarning):
""" """Warning class for features that will be removed in a future version."""
Bases: :class:`pytest.PytestWarning`, :class:`DeprecationWarning`.
Warning class for features that will be removed in a future version.
"""
__module__ = "pytest" __module__ = "pytest"
class PytestExperimentalApiWarning(PytestWarning, FutureWarning): class PytestExperimentalApiWarning(PytestWarning, FutureWarning):
""" """Warning category used to denote experiments in pytest.
Bases: :class:`pytest.PytestWarning`, :class:`FutureWarning`.
Warning category used to denote experiments in pytest. Use sparingly as the API might change or even be Use sparingly as the API might change or even be removed completely in a
removed completely in future version future version.
""" """
__module__ = "pytest" __module__ = "pytest"
@ -90,22 +65,19 @@ class PytestExperimentalApiWarning(PytestWarning, FutureWarning):
class PytestUnhandledCoroutineWarning(PytestWarning): class PytestUnhandledCoroutineWarning(PytestWarning):
""" """Warning emitted for an unhandled coroutine.
Bases: :class:`PytestWarning`.
Warning emitted when pytest encounters a test function which is a coroutine, A coroutine was encountered when collecting test functions, but was not
but it was not handled by any async-aware plugin. Coroutine test functions handled by any async-aware plugin.
are not natively supported. Coroutine test functions are not natively supported.
""" """
__module__ = "pytest" __module__ = "pytest"
class PytestUnknownMarkWarning(PytestWarning): class PytestUnknownMarkWarning(PytestWarning):
""" """Warning emitted on use of unknown markers.
Bases: :class:`PytestWarning`.
Warning emitted on use of unknown markers.
See https://docs.pytest.org/en/latest/mark.html for details. See https://docs.pytest.org/en/latest/mark.html for details.
""" """