summaryrefslogtreecommitdiff
path: root/Lib/packaging/tests/__main__.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/packaging/tests/__main__.py')
-rw-r--r--Lib/packaging/tests/__main__.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/Lib/packaging/tests/__main__.py b/Lib/packaging/tests/__main__.py
new file mode 100644
index 0000000000..0f175cf961
--- /dev/null
+++ b/Lib/packaging/tests/__main__.py
@@ -0,0 +1,23 @@
+"""Packaging test suite runner."""
+
+# Ripped from importlib tests, thanks Brett!
+
+import os
+import sys
+import unittest
+from test.support import run_unittest, reap_children, reap_threads
+
+
+@reap_threads
+def test_main():
+ 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__':
+ test_main()