summaryrefslogtreecommitdiffstats
path: root/Lib/importlib/test/__main__.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2009-07-15 04:08:33 (GMT)
committerBrett Cannon <bcannon@gmail.com>2009-07-15 04:08:33 (GMT)
commitb49c70c7d30361856b73e0cf8de7cd6ad3af5e9f (patch)
tree7202abb69d89050068f426da408cf01b6375b7d8 /Lib/importlib/test/__main__.py
parentd8840860df164191ae5ab81d37435517f0d0a31b (diff)
downloadcpython-b49c70c7d30361856b73e0cf8de7cd6ad3af5e9f.zip
cpython-b49c70c7d30361856b73e0cf8de7cd6ad3af5e9f.tar.gz
cpython-b49c70c7d30361856b73e0cf8de7cd6ad3af5e9f.tar.bz2
Importlib was using custom code to discover all test modules in importlib.test.
This has now been removed in favor of using unittest's test discovery code in TestLoader.discover().
Diffstat (limited to 'Lib/importlib/test/__main__.py')
-rw-r--r--Lib/importlib/test/__main__.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/importlib/test/__main__.py b/Lib/importlib/test/__main__.py
new file mode 100644
index 0000000..d0710bd
--- /dev/null
+++ b/Lib/importlib/test/__main__.py
@@ -0,0 +1,14 @@
+import os.path
+from test.support import run_unittest
+import unittest
+
+
+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))
+
+
+if __name__ == '__main__':
+ test_main()