Skip to content

Commit 7ce3222

Browse files
authored
Make TerminalReporter public API and add to reference docs #6649 (#12661)
Fixes #6649
1 parent 3594adc commit 7ce3222

File tree

5 files changed

+12
-1
lines changed

5 files changed

+12
-1
lines changed

changelog/6649.doc.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added :class:`~pytest.TerminalReporter` to the :ref:`api-reference` documentation page.

changelog/6649.misc.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added :class:`~pytest.TerminalReporter` to the public pytest API, as it is part of the signature of the :hook:`pytest_terminal_summary` hook.

doc/en/reference/reference.rst

+7
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,13 @@ PytestPluginManager
10131013
:inherited-members:
10141014
:show-inheritance:
10151015

1016+
TerminalReporter
1017+
~~~~~~~~~~~~~~~~
1018+
1019+
.. autoclass:: pytest.TerminalReporter
1020+
:members:
1021+
:inherited-members:
1022+
10161023
TestReport
10171024
~~~~~~~~~~
10181025

src/_pytest/terminal.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,7 @@ def build_summary_stats_line(self) -> tuple[list[tuple[str, dict[str, bool]]], s
13401340
The summary stats line is the line shown at the end, "=== 12 passed, 2 errors in Xs===".
13411341
13421342
This function builds a list of the "parts" that make up for the text in that line, in
1343-
the example above it would be:
1343+
the example above it would be::
13441344
13451345
[
13461346
("12 passed", {"green": True}),

src/pytest/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
from _pytest.runner import CallInfo
6969
from _pytest.stash import Stash
7070
from _pytest.stash import StashKey
71+
from _pytest.terminal import TerminalReporter
7172
from _pytest.terminal import TestShortLogReport
7273
from _pytest.tmpdir import TempPathFactory
7374
from _pytest.warning_types import PytestAssertRewriteWarning
@@ -161,6 +162,7 @@
161162
"version_tuple",
162163
"TempdirFactory",
163164
"TempPathFactory",
165+
"TerminalReporter",
164166
"Testdir",
165167
"TestReport",
166168
"TestShortLogReport",

0 commit comments

Comments
 (0)