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 lazy string formatting for logger #77

Merged
merged 1 commit into from
Feb 25, 2024
Merged

Use lazy string formatting for logger #77

merged 1 commit into from
Feb 25, 2024

Conversation

tonybaloney
Copy link
Collaborator

This pull request primarily refactors the logging statements in the pytest_nunit/plugin.py file. The changes replace the usage of format() method for string formatting in the debug logs with the %s placeholder, which is a more preferred way for string formatting in logging.

Here are the key changes:

  • pytest_nunit/plugin.py - def __init__(self, nodeid, nunit_xml):: Replaced the format() method with %s for string formatting in the debug log statement.
  • pytest_nunit/plugin.py - def record_testreport(self, testreport):: Updated two debug log statements, replacing the format() method with %s for string formatting. [1] [2]

Fixes #68

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.42%. Comparing base (78f3a60) to head (35c979a).

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #77   +/-   ##
=======================================
  Coverage   92.42%   92.42%           
=======================================
  Files           5        5           
  Lines         541      541           
=======================================
  Hits          500      500           
  Misses         41       41           

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

@tonybaloney tonybaloney merged commit 02fec82 into master Feb 25, 2024
18 checks passed
@tonybaloney tonybaloney deleted the lazy_logging branch February 25, 2024 22:26
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.

Calls to log trigger basicConfig
2 participants