]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wxPython/py/tests/testall.py
wxPython Merge #2 of 2.4 branch --> HEAD (branch tag: wxPy_2_4_merge_2)
[wxWidgets.git] / wxPython / wxPython / py / tests / testall.py
diff --git a/wxPython/wxPython/py/tests/testall.py b/wxPython/wxPython/py/tests/testall.py
new file mode 100644 (file)
index 0000000..22669e7
--- /dev/null
@@ -0,0 +1,25 @@
+#!/usr/bin/env python
+
+__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
+__cvsid__ = "$Id$"
+__revision__ = "$Revision$"[11:-2]
+
+
+import unittest
+import glob
+import os
+
+
+def suite():
+    """Return a test suite containing all test cases in all test modules. 
+    Searches the current directory for any modules matching test_*.py."""
+    suite = unittest.TestSuite()
+    for filename in glob.glob('test_*.py'):
+        module = __import__(os.path.splitext(filename)[0])
+        suite.addTest(unittest.defaultTestLoader.loadTestsFromModule(module))
+    return suite
+
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='suite')
+