Esiegerman/summary colors#776
Conversation
|
Thanks, taking the liberty to add a link to the original PR: https://bitbucket.org/pytest-dev/pytest/pull-request/304 |
testing/test_terminal.py
Outdated
There was a problem hiding this comment.
Re. the spacing, you mean? Will do. (A previous change of mine was accepted looking like this, so I did the same this time.)
There was a problem hiding this comment.
yes spacing, it's not per pep8
not sure why new code should break pep8
There was a problem hiding this comment.
Well, because, as PEP8 itself says:
Some other good reasons to ignore a particular guideline:
- When applying the guideline would make the code less readable, even for someone who is used to reading code that follows this PEP.
IMO, code that's essentially a big table is more readable when it's formatted as such.
I wasn't sure what pytest's conventions are, so I submitted the code in the format I prefer. If that isn't what pytest prefers, I'm happy to change it -- but I'd rather not do that until I'm finished with it, i.e. until everything else about the PR has been approved.
|
I'm 👍 on the idea behind this PR, btw. 😄 |
testing/test_terminal.py
Outdated
|
Propagating comments from Bitbucket... @hpk42 wrote:
To which I responded:
If folks like the idea of separate markers for "fails intermittently" vs. "fails always":
|
|
I agree there should be some difference between "is expected to fail" and "is flaky". I personally use IMHO, |
I like this idea... I have used Backward compatibility aside: Supposing then that we have two different marks, Backward compatibility back on: unfortunately we can't change the current meaning of Perhaps a new mark is out of the scope of this PR, and we should just agree that |
Agreed. I think changing xpass/xfail behaviour is also out of scope. I thought that making xpass red was a trivial change -- didn't realize the larger issues involved. So I'll factor that out of this PR. |
|
[ OK, I've pretty much started from scratch. I wasn't sure how this project feels about In this version, xpass is treated the same as xfailed, deselected and skip: it's ignored when deciding what color the summary bar should be. Thus, if you have "5 passed, 3 xfailed, 1 xpassed", you get a green bar, but if you only have "3 xfailed, 1 xpassed", you get yellow. Rationale: since the meaning of xpass is indeterminate (see earlier discussion in this PR), there's no obvious correct color to give it -- green is no better than red, since either one might be a lie. I've also backed the implementation off to the old one, much more lightly modified, at @hpk42's request. I have not yet PEP8'ified the test cases. I'll do that just before merge; as long as we're still hashing things out, I find the nicely columnar format a lot easier to work with. |
We have not discussed this in detail, but I think it is OK if you're the only person working on the branch. But please do rebase it/clean up the commits once we are ready to merge. 😄
Seems fair enough to me! 😄 |
|
Looks 👍 to me. 😄 |
|
Looks good to me as well! |
5493562 to
7b989e6
Compare
--HG-- branch : esiegerman/summary_colors
This makes it easier to identify failing tests.
Check for the empty-key special case in the first loop, not the second.
Also if we see any statuses the code doesn't know about.
Passing tests override that default, making the color green; but several other "boring" statuses (xfailed, xpassed, deselected, skipped) have no effect. Net effect: if only "boring" tests are seen, or no tests at all, the summary bar is yellow.
7b989e6 to
afcad74
Compare
|
Junk commits removed; remaining commits slightly reorganized; PEP8ified; rebased. No functional change. |
|
Many thanks @esiegerman! 😄 One last request (sorry for not mentioning it earlier): Please add yourself to I will merge this shortly if no one opposes this. |
|
Done. I've called it only a partial fix for #500, as that issue's OP asked in a comment for an explicit warning message (as well as the color change). |
Recreating this PR on Github. No change from the Bitbucket version, except that it's been rebased against master -- so there's nothing new to review until I update it.