Skip to content

Commit 02fec82

Browse files
authored
Merge pull request #77 from pytest-dev/lazy_logging
Use lazy string formatting for logger
2 parents 78f3a60 + 35c979a commit 02fec82

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pytest_nunit/plugin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def __init__(self, nodeid, nunit_xml):
130130

131131
def record_testreport(self, testreport):
132132
"""Export to XML."""
133-
log.debug("record_test_report:{0}".format(testreport))
133+
log.debug("record_test_report:%s", testreport)
134134

135135
if testreport.when == "setup":
136136
r = self.nunit_xml.cases[testreport.nodeid] = {
@@ -155,7 +155,7 @@ def record_testreport(self, testreport):
155155
r["stop"] = datetime.now(timezone.utc) # Will be overridden if called
156156
r["duration"] = 0 # Updated on teardown
157157
if testreport.outcome == "skipped":
158-
log.debug("skipping : {0}".format(testreport.longrepr))
158+
log.debug("skipping : %s", testreport.longrepr)
159159
if (
160160
isinstance(testreport.longrepr, tuple)
161161
and len(testreport.longrepr) > 2
@@ -281,7 +281,7 @@ def __init__(
281281
self.show_username = show_username
282282
self.show_user_domain = show_user_domain
283283
self.attach_on = attach_on
284-
logging.debug("Attach on criteria : {0}".format(attach_on))
284+
log.debug("Attach on criteria : %s", attach_on)
285285
self.idrefindex = 100 # Create a unique ID counter
286286
self.filters = filters
287287

0 commit comments

Comments
 (0)