mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
GH-103805: Lib test f541 linting issue fix (#103812)
This PR makes some minor linting adjustments to the Lib/test module caught by [ruff](https://github.com/charliermarsh/ruff). The adjustments are all related to the `F541 f-string without any placeholders` issue. Issue: https://github.com/python/cpython/issues/103805 <!-- gh-issue-number: gh-103805 --> * Issue: gh-103805 <!-- /gh-issue-number --> --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
This commit is contained in:
parent
df3173d28e
commit
8291ae31dd
14 changed files with 90 additions and 90 deletions
|
@ -394,17 +394,17 @@ class TestLauncher(unittest.TestCase, RunPyMixin):
|
|||
|
||||
def test_filter_to_tag(self):
|
||||
company = "PythonTestSuite"
|
||||
data = self.run_py([f"-V:3.100"])
|
||||
data = self.run_py(["-V:3.100"])
|
||||
self.assertEqual("X.Y.exe", data["LaunchCommand"])
|
||||
self.assertEqual(company, data["env.company"])
|
||||
self.assertEqual("3.100", data["env.tag"])
|
||||
|
||||
data = self.run_py([f"-V:3.100-32"])
|
||||
data = self.run_py(["-V:3.100-32"])
|
||||
self.assertEqual("X.Y-32.exe", data["LaunchCommand"])
|
||||
self.assertEqual(company, data["env.company"])
|
||||
self.assertEqual("3.100-32", data["env.tag"])
|
||||
|
||||
data = self.run_py([f"-V:3.100-arm64"])
|
||||
data = self.run_py(["-V:3.100-arm64"])
|
||||
self.assertEqual("X.Y-arm64.exe -X fake_arg_for_test", data["LaunchCommand"])
|
||||
self.assertEqual(company, data["env.company"])
|
||||
self.assertEqual("3.100-arm64", data["env.tag"])
|
||||
|
@ -421,7 +421,7 @@ class TestLauncher(unittest.TestCase, RunPyMixin):
|
|||
def test_filter_with_single_install(self):
|
||||
company = "PythonTestSuite1"
|
||||
data = self.run_py(
|
||||
[f"-V:Nonexistent"],
|
||||
["-V:Nonexistent"],
|
||||
env={"PYLAUNCHER_LIMIT_TO_COMPANY": company},
|
||||
expect_returncode=103,
|
||||
)
|
||||
|
@ -500,7 +500,7 @@ class TestLauncher(unittest.TestCase, RunPyMixin):
|
|||
data = self.run_py(["--version"], argv=f'{argv0} --version')
|
||||
self.assertEqual("PythonTestSuite", data["SearchInfo.company"])
|
||||
self.assertEqual("3.100", data["SearchInfo.tag"])
|
||||
self.assertEqual(f'X.Y.exe --version', data["stdout"].strip())
|
||||
self.assertEqual("X.Y.exe --version", data["stdout"].strip())
|
||||
|
||||
def test_py_default_in_list(self):
|
||||
data = self.run_py(["-0"], env=TEST_PY_ENV)
|
||||
|
@ -662,7 +662,7 @@ class TestLauncher(unittest.TestCase, RunPyMixin):
|
|||
self.assertIn("9PJPW5LDXLZ5", cmd)
|
||||
|
||||
def test_literal_shebang_absolute(self):
|
||||
with self.script(f"#! C:/some_random_app -witharg") as script:
|
||||
with self.script("#! C:/some_random_app -witharg") as script:
|
||||
data = self.run_py([script])
|
||||
self.assertEqual(
|
||||
f"C:\\some_random_app -witharg {script}",
|
||||
|
@ -670,7 +670,7 @@ class TestLauncher(unittest.TestCase, RunPyMixin):
|
|||
)
|
||||
|
||||
def test_literal_shebang_relative(self):
|
||||
with self.script(f"#! ..\\some_random_app -witharg") as script:
|
||||
with self.script("#! ..\\some_random_app -witharg") as script:
|
||||
data = self.run_py([script])
|
||||
self.assertEqual(
|
||||
f"{script.parent.parent}\\some_random_app -witharg {script}",
|
||||
|
@ -678,14 +678,14 @@ class TestLauncher(unittest.TestCase, RunPyMixin):
|
|||
)
|
||||
|
||||
def test_literal_shebang_quoted(self):
|
||||
with self.script(f'#! "some random app" -witharg') as script:
|
||||
with self.script('#! "some random app" -witharg') as script:
|
||||
data = self.run_py([script])
|
||||
self.assertEqual(
|
||||
f'"{script.parent}\\some random app" -witharg {script}',
|
||||
data["stdout"].strip(),
|
||||
)
|
||||
|
||||
with self.script(f'#! some" random "app -witharg') as script:
|
||||
with self.script('#! some" random "app -witharg') as script:
|
||||
data = self.run_py([script])
|
||||
self.assertEqual(
|
||||
f'"{script.parent}\\some random app" -witharg {script}',
|
||||
|
@ -693,7 +693,7 @@ class TestLauncher(unittest.TestCase, RunPyMixin):
|
|||
)
|
||||
|
||||
def test_literal_shebang_quoted_escape(self):
|
||||
with self.script(f'#! some\\" random "app -witharg') as script:
|
||||
with self.script('#! some\\" random "app -witharg') as script:
|
||||
data = self.run_py([script])
|
||||
self.assertEqual(
|
||||
f'"{script.parent}\\some\\ random app" -witharg {script}',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue