[CMF-checkins] CVS: CMF/CMFCore/tests - test_all.py:1.13.2.1

Chris Withers chrisw@nipltd.com
Tue, 12 Feb 2002 09:13:11 -0500


Update of /cvs-repository/CMF/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv10109/CMFCore/tests

Modified Files:
      Tag: ChrisW-refactor_tests-branch
	test_all.py 
Log Message:
Factored out the crap in test_all so adding new test modules is a lot easier.

=== CMF/CMFCore/tests/test_all.py 1.13 => 1.13.2.1 ===
-from unittest import TestSuite, main
-from sys import modules
+from unittest import main
+from Products.CMFCore.tests.base.utils import build_test_suite
+
 def test_suite():
-    suite = TestSuite()
-    for name in [
+
+    return build_test_suite('Products.CMFCore.tests',[
         'test_ContentTypeRegistry',
         'test_PortalFolder',
         'test_TypesTool',
@@ -15,15 +16,7 @@
         'test_DirectoryView',
         'test_FSPythonScript',
         'test_FSPageTemplate'
-        ]:
-        __import__('Products.CMFCore.tests.'+name,globals(),locals())
-        suite.addTest(
-            modules['Products.CMFCore.tests.'+name].test_suite()
-            )
-    return suite
-
-def run():
-    main(defaultTest='test_suite')
+        ])
 
 if __name__ == '__main__':
-    run()
+    main(defaultTest='test_suite')