Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --force-short-summary option and extend sequence printing with -vv #13061

Merged
merged 2 commits into from
Jan 26, 2025

Conversation

kenny-y-dev
Copy link
Contributor

Closes #12713.

The fix for issue #11777 removed any output shortening in the test summary output when -vv is used, leading to potentially long/redundant summary messages. The issue in #11777 is also now fully fixed, as series were still condensed in output even with full verbosity.

Since the removal of the summary shortening has been in place for a while, the addition of a new runtime option seemed to be the best way to address #12713 without changes to existing functionality. --force-short-summary was added to always show a shortened summary message regardless of the verbosity setting. Additionally, when using -vv, saferepr_unlimited is now called to fully resolve #11777.

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Dec 15, 2024
@kenny-y-dev
Copy link
Contributor Author

@nicoddemus @bluetech @RonnyPfannschmidt @The-Compiler
Hi all! I'd opened this PR near the holidays so thinking it may have gotten missed, could it get a review please? Thanks!

Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

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

This seems useful in the short term

I hope we can eventually fold it into the idea of verbosity categories that currently is in limbo

@@ -1467,7 +1474,9 @@ def _get_line_with_reprcrash_message(
except AttributeError:
pass
else:
if running_on_ci() or config.option.verbose >= 2:
if (
running_on_ci() or config.option.verbose >= 2
Copy link
Member

Choose a reason for hiding this comment

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

This one is getting tricky

But I'm torn about whether there should be a helper

@nicoddemus nicoddemus added this to the 8.4 milestone Jan 24, 2025
@kenny-y-dev
Copy link
Contributor Author

Appreciate the review! Happy to help out if/when the verbosity categories come out of limbo; I got a decent amount of familiarity with the current systems putting this PR together, so would be glad to put that to use. Thanks!

This option allows the users to always see the "short test summary" section regardless of the verbosity level.

Fix pytest-dev#12713
Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

Thanks @kenny-y-dev for the PR!

Took the liberty of splitting the PR into two commits, so can backport the bugfix. 👍

@nicoddemus nicoddemus merged commit bfb8648 into pytest-dev:main Jan 26, 2025
28 checks passed
@nicoddemus
Copy link
Member

Backport: #13163

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
3 participants