@@ -227,7 +227,7 @@ def pytest_report_header(config):
227227
228228 session_timeout = config .getoption ("session_timeout" )
229229 if session_timeout :
230- timeout_header .append ("session timeout: %ss" % session_timeout )
230+ timeout_header .append (f "session timeout: { session_timeout } s" )
231231 if timeout_header :
232232 return timeout_header
233233 return None
@@ -413,7 +413,7 @@ def _parse_marker(marker):
413413 """
414414 if not marker .args and not marker .kwargs :
415415 raise TypeError ("Timeout marker must have at least one argument" )
416- timeout = method = func_only = NOTSET = object ()
416+ timeout = method = func_only = NOTSET = object () # noqa: N806
417417 for kw , val in marker .kwargs .items ():
418418 if kw == "timeout" :
419419 timeout = val
@@ -448,9 +448,8 @@ def _validate_timeout(timeout, where):
448448 return None
449449 try :
450450 return float (timeout )
451- except ValueError :
452- msg = f"Invalid timeout { timeout } from { where } "
453- raise ValueError (msg )
451+ except ValueError as err :
452+ raise ValueError (f"Invalid timeout { timeout } from { where } " ) from err
454453
455454
456455def _validate_method (method , where ):
@@ -476,8 +475,8 @@ def _validate_disable_debugger_detection(disable_debugger_detection, where):
476475 return None
477476 if not isinstance (disable_debugger_detection , bool ):
478477 raise ValueError (
479- "Invalid disable_debugger_detection value %s from %s "
480- % ( disable_debugger_detection , where )
478+ f "Invalid disable_debugger_detection value { disable_debugger_detection } "
479+ f" from { where } "
481480 )
482481 return disable_debugger_detection
483482
0 commit comments