summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-07-15 21:26:19 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-07-15 21:26:19 (GMT)
commitdb535957cd4b44c6176e49dc2d28f034ece5262c (patch)
treeb987101d335dd84e57352825dbd0897e7ba63951
parent9e42a4dbaa53250965039932a44eb2771e737648 (diff)
downloadcpython-db535957cd4b44c6176e49dc2d28f034ece5262c.zip
cpython-db535957cd4b44c6176e49dc2d28f034ece5262c.tar.gz
cpython-db535957cd4b44c6176e49dc2d28f034ece5262c.tar.bz2
test_packaging should clean up after itself (but it doesn't really)
-rw-r--r--Lib/packaging/tests/__main__.py15
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__':