Skip to content

Use add_color_level() conditionally #1592

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cidlik
Copy link

@cidlik cidlik commented Feb 2, 2025

Description
According to [1] add_color_level() is a method of ColoredLevelFormatter
only. The exception AttributeError is raised for other formatters.

[1] https://github.com/pytest-dev/pytest/blob/main/src/_pytest/logging.py#L104

Checklist

  • Documentation for the feature
  • Tests for the feature
  • The arguments and description in doc/configuration.rst have been updated
  • Add a section on how to use the feature to doc/usage.rst
  • Add a section on how to use the feature to doc/development.rst
  • PR has been tested
  • Man pages have been regenerated

Emantor
Emantor previously approved these changes Feb 4, 2025
@Emantor
Copy link
Member

Emantor commented Feb 4, 2025

Thanks for the PR, this is missing a DCO, you can add this with git commit --amend -s and doing a force push to the branch.

Copy link

codecov bot commented Feb 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.8%. Comparing base (c609d2d) to head (36a898a).
Report is 15 commits behind head on master.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1592     +/-   ##
========================================
- Coverage    56.0%   55.8%   -0.3%     
========================================
  Files         170     170             
  Lines       13307   13369     +62     
========================================
+ Hits         7458    7461      +3     
- Misses       5849    5908     +59     
Flag Coverage Δ
3.10 55.8% <100.0%> (-0.3%) ⬇️
3.11 55.8% <100.0%> (-0.3%) ⬇️
3.12 55.8% <100.0%> (-0.3%) ⬇️
3.13 55.7% <100.0%> (-0.3%) ⬇️
3.9 55.8% <100.0%> (-0.3%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cidlik cidlik force-pushed the add-color-level-issue branch from 2c6c3b8 to 36a898a Compare February 4, 2025 18:30
@cidlik cidlik requested a review from Emantor February 6, 2025 07:08
@Emantor Emantor force-pushed the add-color-level-issue branch from 0b5172b to 4d98bb2 Compare February 17, 2025 07:06
@Emantor
Copy link
Member

Emantor commented Feb 17, 2025

Your name in the DCO matches, but the email adress does not.

According to [1] add_color_level() is a method of ColoredLevelFormatter
only.

[1] https://github.com/pytest-dev/pytest/blob/main/src/_pytest/logging.py#L104

Change-Id: Iaa67c613b196b9cbbbc930d547edaa784d545130
Signed-off-by: Roman Kuznecov <[email protected]>
@cidlik
Copy link
Author

cidlik commented Feb 23, 2025

Your name in the DCO matches, but the email adress does not.

Yeap, sorry, it's my bad

@cidlik cidlik removed their assignment Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants