Skip to content
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

Use add_color_level() conditionally #1592

Open
wants to merge 1 commit 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
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 56.0%. Comparing base (c609d2d) to head (2c6c3b8).

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@          Coverage Diff           @@
##           master   #1592   +/-   ##
======================================
  Coverage    56.0%   56.0%           
======================================
  Files         170     170           
  Lines       13307   13308    +1     
======================================
+ Hits         7458    7459    +1     
  Misses       5849    5849           
Flag Coverage Δ
3.10 56.0% <100.0%> (+<0.1%) ⬆️
3.11 56.0% <100.0%> (+<0.1%) ⬆️
3.12 56.0% <100.0%> (+<0.1%) ⬆️
3.13 56.0% <100.0%> (+<0.1%) ⬆️
3.9 56.0% <100.0%> (+<0.1%) ⬆️

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.

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 cidlik force-pushed the add-color-level-issue branch from 2c6c3b8 to 36a898a Compare February 4, 2025 18:30
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