diff --git a/changelog/6649.doc.rst b/changelog/6649.doc.rst new file mode 100644 index 00000000000..cf5bb781b87 --- /dev/null +++ b/changelog/6649.doc.rst @@ -0,0 +1 @@ +Added :class:`~pytest.TerminalReporter` to the :ref:`api-reference` documentation page. diff --git a/changelog/6649.misc.rst b/changelog/6649.misc.rst new file mode 100644 index 00000000000..cec8c3f4506 --- /dev/null +++ b/changelog/6649.misc.rst @@ -0,0 +1 @@ +Added :class:`~pytest.TerminalReporter` to the public pytest API, as it is part of the signature of the :hook:`pytest_terminal_summary` hook. diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 099c8a00260..3a5063b6b58 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1013,6 +1013,13 @@ PytestPluginManager :inherited-members: :show-inheritance: +TerminalReporter +~~~~~~~~~~~~~~~~ + +.. autoclass:: pytest.TerminalReporter + :members: + :inherited-members: + TestReport ~~~~~~~~~~ diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index 8c722124d04..cdda5a90ea1 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -1340,7 +1340,7 @@ def build_summary_stats_line(self) -> tuple[list[tuple[str, dict[str, bool]]], s The summary stats line is the line shown at the end, "=== 12 passed, 2 errors in Xs===". This function builds a list of the "parts" that make up for the text in that line, in - the example above it would be: + the example above it would be:: [ ("12 passed", {"green": True}), diff --git a/src/pytest/__init__.py b/src/pytest/__init__.py index 90abcdab036..92152b7c7b4 100644 --- a/src/pytest/__init__.py +++ b/src/pytest/__init__.py @@ -68,6 +68,7 @@ from _pytest.runner import CallInfo from _pytest.stash import Stash from _pytest.stash import StashKey +from _pytest.terminal import TerminalReporter from _pytest.terminal import TestShortLogReport from _pytest.tmpdir import TempPathFactory from _pytest.warning_types import PytestAssertRewriteWarning @@ -161,6 +162,7 @@ "version_tuple", "TempdirFactory", "TempPathFactory", + "TerminalReporter", "Testdir", "TestReport", "TestShortLogReport",