-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Display "short test summary info" after (main) warnings again #4399
Conversation
self.summary_warnings() | ||
yield |
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.
"short test summary info" comes via the skipping plugin, which I found rather confusing.
Should/can this be moved?
It would also might make sense to have "short test summary info" after "summary_passes" even, but I wanted to not touch that behavior (and am not using it - -ra
does not include P
).
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.
Hmmm if we move it to pytest_terminal_summary
, will it simplify things? It doesn't look so simple to move it, because there's some logic in there to handle summaries for xpass, xfail, etc.
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.
Yes, it is quite messy.
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.
Perhaps we should add a comment here explaining why we display warnings twice, what do you think?
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.
Makes sense.
@@ -726,11 +727,19 @@ def summary_warnings(self): | |||
if not all_warnings: | |||
return | |||
|
|||
final = hasattr(self, "_already_displayed_warnings") |
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.
Hmm I'm not sure, I understand the rationale for the change, but I'm not so happy with how this turns out... 🤔
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've tried to use args for this first, but considered that there are only 2 steps and an attribute/marker can do it.
I've tried to keep the patch minimal.
@nicoddemus |
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.
This solves a real problem and I don't see a clearer way to implement this, so I'm 👍 for the change, thanks!
Would like a second eyes on it before we merge it though.
self.summary_warnings() | ||
yield |
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.
Perhaps we should add a comment here explaining why we display warnings twice, what do you think?
Added the comment. (normally I would have pushed this as a fixup with |
Codecov Report
@@ Coverage Diff @@
## master #4399 +/- ##
==========================================
+ Coverage 95.87% 95.92% +0.04%
==========================================
Files 111 111
Lines 25061 25001 -60
Branches 2445 2440 -5
==========================================
- Hits 24028 23981 -47
+ Misses 726 723 -3
+ Partials 307 297 -10
Continue to review full report at Codecov.
|
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.
how and where to communicate the details is indeed up to taste and api stability
we can think about writing this cleaner as a followup - the decomposition wont be directly oblivious as its indeed a tricky case
I will get this merged now as we know it has passed in the previous commit, and the only change has been a comment. 😁 Thanks @blueyed! |
else: | ||
warnings = all_warnings | ||
self._already_displayed_warnings = len(warnings) | ||
|
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.
We should move the conditional from the top of the method to this point:
if not warnings:
return
That's why we are seeing double warnings summary even if the "final" summary has no warnings to show. 👍
Fixes #3952.
Ref: #3956.