mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
GH-107458: fix test_tools refleak (#107577)
This commit is contained in:
parent
62a3a15119
commit
46366ca048
1 changed files with 5 additions and 11 deletions
|
@ -19,17 +19,11 @@ class TestSundryScripts(unittest.TestCase):
|
||||||
# cleanly the logging module.
|
# cleanly the logging module.
|
||||||
@import_helper.mock_register_at_fork
|
@import_helper.mock_register_at_fork
|
||||||
def test_sundry(self, mock_os):
|
def test_sundry(self, mock_os):
|
||||||
old_modules = import_helper.modules_setup()
|
for fn in os.listdir(scriptsdir):
|
||||||
try:
|
if not fn.endswith('.py'):
|
||||||
for fn in os.listdir(scriptsdir):
|
continue
|
||||||
if not fn.endswith('.py'):
|
name = fn[:-3]
|
||||||
continue
|
import_tool(name)
|
||||||
|
|
||||||
name = fn[:-3]
|
|
||||||
import_tool(name)
|
|
||||||
finally:
|
|
||||||
# Unload all modules loaded in this test
|
|
||||||
import_helper.modules_cleanup(*old_modules)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue