FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Include TerminalReporter in reference docs #6649 by soxofaan · Pull Request #12661 · pytest-dev/pytest · GitHub

Include TerminalReporter in reference docs #6649 - #12661

Merged
nicoddemus merged 6 commits into
pytest-dev:mainfrom
soxofaan:issue6649-terminalreporter-docs
Jul 29, 2024
Merged

Include TerminalReporter in reference docs #6649#12661
nicoddemus merged 6 commits into
pytest-dev:mainfrom
soxofaan:issue6649-terminalreporter-docs

Conversation

soxofaan commented Jul 25, 2024
edited
Loading

Copy link
Copy Markdown
Contributor

Closes #6649

  • Include documentation when adding new features.
  • Include new tests or update existing tests when applicable.
  • Allow maintainers to push and squash when merging my commits. Please uncheck this if you prefer to squash the commits yourself.
  • Add text like closes #XYZW to the PR description and/or commits (where XYZW is the issue number). See the github docs for more information.
  • Create a new changelog file in the changelog folder, with a name like <ISSUE NUMBER>.<TYPE>.rst. See changelog/README.rst for details.
  • Add yourself to AUTHORS in alphabetical order.

soxofaan force-pushed the issue6649-terminalreporter-docs branch from d020e1b to e3a6c63 Compare July 25, 2024 16:31
psf-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Jul 25, 2024

Copy link
Copy Markdown
Contributor Author

I'm wondering if I should/can add an import of TerminalReporter somewhere around

from _pytest.stash import StashKey
from _pytest.terminal import TestShortLogReport
from _pytest.tmpdir import TempPathFactory

nicoddemus left a comment
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Hi @soxofaan, thanks for the PR.

The TerminalReporter not being part of the docs is an oversight, given they are part of the signature of pytest_terminal_summary.

I'm wondering if I should/can add an import of TerminalReporter somewhere around

Yes we should also publish it as part of the public API: if it is used by a public hook, it should also be available from the pytest namespace.

Also the build failed with:

/home/docs/checkouts/readthedocs.org/user_builds/pytest/envs/12661/lib/python3.12/site-packages/_pytest/terminal.py:docstring of _pytest.terminal.TerminalReporter.build_summary_stats_line:11: WARNING: Definition list ends without a blank line; unexpected unindent. 

Probably just need to fix the docstring here:

pytest/src/_pytest/terminal.py

Lines 1342 to 1343 in 6c806b4

This function builds a list of the "parts" that make up for the text in that line, in
the example above it would be:

To:

         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::

It is unfortunate that the entire terminal plugin is being passed along to this hook, but too late for this now so we might as well document it.

Copy link
Copy Markdown
Member

In stoll hoping we can replace it,

It's api is from python 2.4 times and libraries more dedicated to the topic recently showed a much nicer variant (like rich)

Copy link
Copy Markdown
Contributor Author

thanks for the feedback. All tests pass now

soxofaan requested a review from nicoddemus July 26, 2024 08:43

Copy link
Copy Markdown
Member

It's api is from python 2.4 times and libraries more dedicated to the topic recently showed a much nicer variant (like rich)

I know, let's hope we manage to eventually find the time (and will) to do that. 🤞

Comment thread changelog/6649.doc.rst Outdated

Copy link
Copy Markdown
Member

This while small should not be backported, as it is introducing a new public symbol, so it should happen in the next minor release.

nicoddemus enabled auto-merge (squash) July 26, 2024 11:12

Copy link
Copy Markdown
Member

@RonnyPfannschmidt build_summary_stats_line now appears in the docs... want to mark it as private instead (using :private: in the docstring)?

Copy link
Copy Markdown
Member

(I have a local fix for the docs, will push shortly)

nicoddemus disabled auto-merge July 26, 2024 14:52
nicoddemus merged commit 7ce3222 into pytest-dev:main Jul 29, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doc: TerminalReporter is not documented

3 participants


Back | FazBrowse Home | New Git URL