[ruff UP031] Fix to use format specifiers instead of percent format

This commit is contained in:
Pierre Sassoulas
2024-04-30 18:06:26 +02:00
parent da53e29780
commit 4788165e69
52 changed files with 202 additions and 212 deletions

View File

@@ -36,9 +36,9 @@ class TestModule:
[
"*import*mismatch*",
"*imported*test_whatever*",
"*%s*" % p1,
f"*{p1}*",
"*not the same*",
"*%s*" % p2,
f"*{p2}*",
"*HINT*",
]
)

View File

@@ -2268,18 +2268,17 @@ class TestFixtureMarker:
This was a regression introduced in the fix for #736.
"""
pytester.makepyfile(
"""
f"""
import pytest
@pytest.fixture(params=[1, 2])
def fixt(request):
return request.param
@pytest.mark.parametrize(%s, [(3, 'x'), (4, 'x')])
@pytest.mark.parametrize({param_args}, [(3, 'x'), (4, 'x')])
def test_foo(fixt, val):
pass
"""
% param_args
)
reprec = pytester.inline_run()
reprec.assertoutcome(passed=2)