From 20c558c84a4a66c5937e21a4cb7671f5cd6a47d9 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Wed, 21 Feb 2024 16:15:27 +0100 Subject: [PATCH] chore: setuponly - migrate to f string --- src/_pytest/setuponly.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/_pytest/setuponly.py b/src/_pytest/setuponly.py index de297f408..40fe6d5d1 100644 --- a/src/_pytest/setuponly.py +++ b/src/_pytest/setuponly.py @@ -73,13 +73,9 @@ def _show_fixture_action( # Use smaller indentation the higher the scope: Session = 0, Package = 1, etc. scope_indent = list(reversed(Scope)).index(fixturedef._scope) tw.write(" " * 2 * scope_indent) - tw.write( - "{step} {scope} {fixture}".format( # noqa: UP032 (Readability) - step=msg.ljust(8), # align the output to TEARDOWN - scope=fixturedef.scope[0].upper(), - fixture=fixturedef.argname, - ) - ) + + scopename = fixturedef.scope[0].upper() + tw.write(f"{msg:<8} {scopename} {fixturedef.argname}") if msg == "SETUP": deps = sorted(arg for arg in fixturedef.argnames if arg != "request")