summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorKumar Aditya <kumaraditya@python.org>2023-08-03 06:36:02 (GMT)
committerGitHub <noreply@github.com>2023-08-03 06:36:02 (GMT)
commit46366ca0486d07fe94c70d00771482c8ef1546fc (patch)
tree13aae393326daeaa22affd3c01643d78cf62e1a7 /Lib
parent62a3a15119cf16d216a2cc7dc10d97143017ef62 (diff)
downloadcpython-46366ca0486d07fe94c70d00771482c8ef1546fc.zip
cpython-46366ca0486d07fe94c70d00771482c8ef1546fc.tar.gz
cpython-46366ca0486d07fe94c70d00771482c8ef1546fc.tar.bz2
GH-107458: fix test_tools refleak (#107577)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_tools/test_sundry.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/Lib/test/test_tools/test_sundry.py b/Lib/test/test_tools/test_sundry.py
index 2f8ba27..d0b702d 100644
--- a/Lib/test/test_tools/test_sundry.py
+++ b/Lib/test/test_tools/test_sundry.py
@@ -19,17 +19,11 @@ class TestSundryScripts(unittest.TestCase):
# cleanly the logging module.
@import_helper.mock_register_at_fork
def test_sundry(self, mock_os):
- old_modules = import_helper.modules_setup()
- try:
- for fn in os.listdir(scriptsdir):
- if not fn.endswith('.py'):
- continue
-
- name = fn[:-3]
- import_tool(name)
- finally:
- # Unload all modules loaded in this test
- import_helper.modules_cleanup(*old_modules)
+ for fn in os.listdir(scriptsdir):
+ if not fn.endswith('.py'):
+ continue
+ name = fn[:-3]
+ import_tool(name)
if __name__ == '__main__':