-
-
Couldn't load subscription status.
- Fork 2.9k
Fixed color inconsistency in verbose mode #13819
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
base: main
Are you sure you want to change the base?
Conversation
1584ced to
f08f4ca
Compare
|
Thanks for the PR @treyshaffer but this is not an approach we can accept, as it side-steps the entire "flow" of the reports in order to add record this information early. I will leave a comment describing why this happens in the issue, we can discuss other approaches there. We may want to use your tests for the eventual solution. |
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.
After thinking about it more I think the approach can be adapted to a possible solution.
Basically, the idea of stashing the log recorder seems workable, but we shouldn't use user properties for this like the current PR does.
The fix should be entirely confined to the warnings plugin, the terminal code shouldn't need to change.
Basically what we want is to dispatch the pytest_warning_recorded hook calls earlier, not just at the end of runtest_protocol. So stash the warnings records, treating it as a "queue", and then "process" it in e.g. pytest_runtest_makereport (not sure it's the best place but possible).
Thanks for the feedback, you have a good point, and I like that approach more. I'll try to implement it this way and push a new revision |
0000154 to
8df2e57
Compare
Fixed issue where test status showed green instead of yellow for passed tests with warnings in verbose mode. Tests with warnings now correctly display in yellow both during progress and in the final summary. Changes: - Added pytest_report_teststatus hook with tryfirst=True to provide yellow markup for passed tests that have warnings - Set has_warnings attribute on TestReport for xdist compatibility - Added color logic in _determine_main_color to keep progress green while running in verbose mode - Moved TestReport and CallInfo imports out of TYPE_CHECKING block for 100% coverage - Removed unused _nodeids_with_warnings global state (memory leak fix) - Updated test to verify has_warnings attribute directly Fixes pytest-dev#13201 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
8df2e57 to
78af87a
Compare
|
@treyshaffer Is this ready for another review? |
Fixed color inconsistency in verbose mode where test status showed green instead of yellow for passed tests with warnings.
closes #13201