Skip to content

Commit

Permalink
subtest from alex
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Oct 23, 2024
1 parent 336a722 commit 0cea35b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Lib/test/test_import/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ def test_script_shadowing_stdlib(self):
)
]
for script, error in script_errors:
with os_helper.temp_dir() as tmp:
with self.subTest(script=script), os_helper.temp_dir() as tmp:
with open(os.path.join(tmp, "fractions.py"), "w", encoding='utf-8') as f:
f.write(script)

Expand Down Expand Up @@ -870,7 +870,7 @@ def test_package_shadowing_stdlib_module(self):
)
]
for script, error in script_errors:
with os_helper.temp_dir() as tmp:
with self.subTest(script=script), os_helper.temp_dir() as tmp:
os.mkdir(os.path.join(tmp, "fractions"))
with open(
os.path.join(tmp, "fractions", "__init__.py"), "w", encoding='utf-8'
Expand Down Expand Up @@ -910,8 +910,8 @@ def test_script_shadowing_third_party(self):
rb"ImportError: cannot import name 'array' from 'numpy'"
)
]
with os_helper.temp_dir() as tmp:
for script, error in script_errors:
for script, error in script_errors:
with self.subTest(script=script), os_helper.temp_dir() as tmp:
with open(os.path.join(tmp, "numpy.py"), "w", encoding='utf-8') as f:
f.write(script)

Expand Down Expand Up @@ -1113,7 +1113,7 @@ def test_script_shadowing_stdlib_sys_path_modification(self):
)
]
for script, error in script_errors:
with os_helper.temp_dir() as tmp:
with self.subTest(script=script), os_helper.temp_dir() as tmp:
with open(os.path.join(tmp, "fractions.py"), "w", encoding='utf-8') as f:
f.write("shadowing_module = True")
with open(os.path.join(tmp, "main.py"), "w", encoding='utf-8') as f:
Expand Down

0 comments on commit 0cea35b

Please sign in to comment.