diff options
Diffstat (limited to 'Lib/packaging/tests/__main__.py')
-rw-r--r-- | Lib/packaging/tests/__main__.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Lib/packaging/tests/__main__.py b/Lib/packaging/tests/__main__.py index 68ee229..0f175cf 100644 --- a/Lib/packaging/tests/__main__.py +++ b/Lib/packaging/tests/__main__.py @@ -5,15 +5,18 @@ import os import sys import unittest -from test.support import run_unittest, reap_children +from test.support import run_unittest, reap_children, reap_threads +@reap_threads def test_main(): - start_dir = os.path.dirname(__file__) - top_dir = os.path.dirname(os.path.dirname(start_dir)) - test_loader = unittest.TestLoader() - run_unittest(test_loader.discover(start_dir, top_level_dir=top_dir)) - reap_children() + try: + start_dir = os.path.dirname(__file__) + top_dir = os.path.dirname(os.path.dirname(start_dir)) + test_loader = unittest.TestLoader() + run_unittest(test_loader.discover(start_dir, top_level_dir=top_dir)) + finally: + reap_children() if __name__ == '__main__': |