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

Lines changed: 5 additions & 11 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy