Skip to content

Conversation

treyshaffer
Copy link

Fixed color inconsistency in verbose mode where test status showed green instead of yellow for passed tests with warnings.

closes #13201

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Oct 16, 2025
@treyshaffer treyshaffer force-pushed the fix-warning-color-13201 branch 11 times, most recently from f75aecf to 1584ced Compare October 16, 2025 21:03
…een instead of yellow for passed tests with warnings.
@treyshaffer treyshaffer force-pushed the fix-warning-color-13201 branch from 1584ced to f08f4ca Compare October 16, 2025 21:29
@bluetech
Copy link
Member

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.

@bluetech bluetech closed this Oct 18, 2025
@bluetech bluetech reopened this Oct 18, 2025
Copy link
Member

@bluetech bluetech left a 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).

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

Development

Successfully merging this pull request may close these issues.

color of percentage on warning is green with -v

2 participants