Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/6649.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added :class:`~pytest.TerminalReporter` to the :ref:`api-reference` documentation page.
1 change: 1 addition & 0 deletions changelog/6649.misc.rst
Original file line number Diff line number Diff line change
@@ -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.
7 changes: 7 additions & 0 deletions doc/en/reference/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,13 @@ PytestPluginManager
:inherited-members:
:show-inheritance:

TerminalReporter
~~~~~~~~~~~~~~~~

.. autoclass:: pytest.TerminalReporter
:members:
:inherited-members:

TestReport
~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}),
Expand Down
2 changes: 2 additions & 0 deletions src/pytest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -161,6 +162,7 @@
"version_tuple",
"TempdirFactory",
"TempPathFactory",
"TerminalReporter",
"Testdir",
"TestReport",
"TestShortLogReport",
Expand Down