summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/tests/__init__.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2004-06-15 15:49:46 (GMT)
committerFred Drake <fdrake@acm.org>2004-06-15 15:49:46 (GMT)
commitbb7c14461d8c69a9ffd70ae012b28ad35a9f3e78 (patch)
treea6e53692c746123bae1830b8dc95df60036be7cc /Lib/distutils/tests/__init__.py
parenta050171ee9e44697260cd5415310777dadb5555e (diff)
downloadcpython-bb7c14461d8c69a9ffd70ae012b28ad35a9f3e78.zip
cpython-bb7c14461d8c69a9ffd70ae012b28ad35a9f3e78.tar.gz
cpython-bb7c14461d8c69a9ffd70ae012b28ad35a9f3e78.tar.bz2
One unit test for distutils is not much, but is more than we had yesterday.
We need to write more; hopefully the barrier is a little lower now.
Diffstat (limited to 'Lib/distutils/tests/__init__.py')
-rw-r--r--Lib/distutils/tests/__init__.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/Lib/distutils/tests/__init__.py b/Lib/distutils/tests/__init__.py
new file mode 100644
index 0000000..7bdb912
--- /dev/null
+++ b/Lib/distutils/tests/__init__.py
@@ -0,0 +1,35 @@
+"""Test suite for distutils.
+
+This test suite consists of a collection of test modules in the
+distutils.tests package. Each test module has a name starting with
+'test' and contains a function test_suite(). The function is expected
+to return an initialized unittest.TestSuite instance.
+
+Tests for the command classes in the distutils.command package are
+included in distutils.tests as well, instead of using a separate
+distutils.command.tests package, since command identification is done
+by import rather than matching pre-defined names.
+
+"""
+
+import os
+import sys
+import unittest
+
+
+here = os.path.dirname(__file__)
+
+
+def test_suite():
+ suite = unittest.TestSuite()
+ for fn in os.listdir(here):
+ if fn.startswith("test") and fn.endswith(".py"):
+ modname = "distutils.tests." + fn[:-3]
+ __import__(modname)
+ module = sys.modules[modname]
+ suite.addTest(module.test_suite())
+ return suite
+
+
+if __name__ == "__main__":
+ unittest.main(defaultTest="test_suite")