Skip to content

doc: TerminalReporter is not documented #6649

Description

@blueyed

It could be added as follows, but only rewrite has a docstring and would be included.

It is used with the pytest_terminal_summary hook at least, and therefore is public API it seems.

diff --git i/doc/en/reference.rst w/doc/en/reference.rst
index 50e32d660..552ad895b 100644
--- i/doc/en/reference.rst
+++ w/doc/en/reference.rst
@@ -838,6 +838,13 @@ Session
     :members:
     :show-inheritance:

+TerminalReporter
+~~~~~~~~~~~~~~~~
+
+.. autoclass:: _pytest.terminal.TerminalReporter
+    :members:
+    :inherited-members:
+
 TestReport
 ~~~~~~~~~~

Activity

  1. added
    type: bugproblem that needs to be addressed
    type: docsdocumentation improvement, missing or needing clarification
    on Feb 1, 2020
  2. shankarj67 commented on Mar 5, 2020

    @shankarj67

    I would like to work on this. What exactly do I have to do?

  3. blueyed commented on Mar 6, 2020

    @blueyed
    ContributorAuthor

    @shankarj67
    My patch from above might be enough to make it show up in the docs.
    Check tox -e docs to generate them (or make -C doc/en if you have deps installed).
    Then create a PR for it.

    (but it is only my understanding that it should be documented / included, might be worth waiting for feedback from others)

  4. mcsitter commented on May 30, 2020

    @mcsitter
    Contributor

    I build the documentation. You can see the result here:
    grafik
    The page is already very long so this addition should not hurt the usability. Of course it is also properly added in the table of contents with all the links (including to source) working properly.
    grafik

    I assume the reason why only rewrite is shown is because it is the only method with a docstring in the class as the source indicates. Adding relevant docstrings would be great but sadly that is beyond my skills and knowledge.

    I am happy to open a PR for the fix.
    Commit: mcsitter/pytest@5c3296ca21500581224a2e4becefc74995b6752b

  5. soxofaan commented on Jul 25, 2024

    @soxofaan
    Contributor

    same issue here: I was looking into hook pytest_terminal_summary at https://docs.pytest.org/en/latest/reference/reference.html#pytest.hookspec.pytest_terminal_summary but "TerminalReporter" there is a bit of dead end at the moment.

    I think even the minimal docs from the quickfix mentioned above would be useful as it would at least link to the appropriate source code at https://docs.pytest.org/en/latest/_modules/_pytest/terminal.html, which, while spartan, is a lot better than the current dead end.

  6. soxofaan commented on Jul 25, 2024

    @soxofaan
    Contributor

    @blueyed I created PR #12661 from your suggestion. Do you want me to include attribution to you in the changelog entry?

  7. soxofaan commented on Jul 25, 2024

    @soxofaan
    Contributor

    FYI: in the mean time two TerminalReporter methods got docstrings: wrap_write and build_summary_stats_line

    The added doc section now looks like:
    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugproblem that needs to be addressedtype: docsdocumentation improvement, missing or needing clarification

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions