-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Always show full comparison output if on CI. #1314
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
Always show full comparison output if on CI. #1314
Conversation
@@ -113,7 +115,8 @@ def callbinrepr(op, left, right): | |||
for new_expl in hook_result: | |||
if new_expl: | |||
if (sum(len(p) for p in new_expl[1:]) > 80*8 | |||
and item.config.option.verbose < 2): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think its time to factor that into a _format_expl(lines, verbose)
function and invoke it before fixing the rewrite mod changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get what you mean with "before fixing the rewrite mod changes".
And I have to disagree - callbinrepr
doesn't seem very long as-is, and moving the stuff under if new_expl
to a new function (if that's what you propose) doesn't really change much, IMHO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, if anything (and this is nitpick), I would move the sum(len(p) for p in new_expl[1:]) > 80*8
expression into a local variable expression_too_long
for legibility... but as I said, really minor and doesn't block this PR. 😁
Cool, good idea! I'm all in favor of pytest being "smart" and display a better behavior when running on a CI server. |
If |
@@ -26,6 +26,10 @@ | |||
including removal of the obsolete ``_pytest.assertion.oldinterpret`` module. | |||
Thanks `@nicoddemus`_ for the PR (`#1226`_). | |||
|
|||
* Comparisons now always show up in full when 'CI' is found in the environment, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@The-Compiler you think we should also mention that BUILD_NUMBER
is considered, or be a little vague instead and mention "in Continuous Integration environments" instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to be explicit as long as it's only two variables anyways 😉 Changed.
When you don't get enough information with a test running on a CI, it's quite frustrating, for various reasons: - It's more likely to be a flaky test, so you might not be able to reproduce the failure. - Passing -vv is quite bothersome (creating a temporary commit and reverting it) For those reasons, if something goes wrong on CI, it's good to have as much information as possible.
Always show full comparison output if on CI.
follow-up to pytest-dev#1314, for similar reasons closes pytest-dev#9023
follow-up to pytest-dev#1314, for similar reasons closes pytest-dev#9023
When you don't get enough information with a test running on a CI, it's quite
frustrating, for various reasons:
the failure.
it)
For those reasons, if something goes wrong on CI, it's good to have as much
information as possible.