Skip to content

Commit 46366ca

Browse files
GH-107458: fix test_tools refleak (#107577)
1 parent 62a3a15 commit 46366ca

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

Lib/test/test_tools/test_sundry.py

+5-11
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,11 @@ class TestSundryScripts(unittest.TestCase):
1919
# cleanly the logging module.
2020
@import_helper.mock_register_at_fork
2121
def test_sundry(self, mock_os):
22-
old_modules = import_helper.modules_setup()
23-
try:
24-
for fn in os.listdir(scriptsdir):
25-
if not fn.endswith('.py'):
26-
continue
27-
28-
name = fn[:-3]
29-
import_tool(name)
30-
finally:
31-
# Unload all modules loaded in this test
32-
import_helper.modules_cleanup(*old_modules)
22+
for fn in os.listdir(scriptsdir):
23+
if not fn.endswith('.py'):
24+
continue
25+
name = fn[:-3]
26+
import_tool(name)
3327

3428

3529
if __name__ == '__main__':

0 commit comments

Comments
 (0)