[CMF-checkins] CVS: CMF - all_cmf_tests.py:1.3
Chris Withers
chrisw@nipltd.com
Fri, 15 Feb 2002 14:46:03 -0500
Update of /cvs-repository/CMF
In directory cvs.zope.org:/tmp/cvs-serv10707
Modified Files:
all_cmf_tests.py
Log Message:
The unit tests hopefully smell better now. Please try and keep them this way. Look in CMFCore/tests/base for commonly used artifacts.
=== CMF/all_cmf_tests.py 1.2 => 1.3 ===
-import unittest
+from unittest import TestSuite,main
+from Products.CMFCore.tests.base.utils import build_test_suite
-from Products.CMFCore.tests import test_all
-core_tests = test_all
+def test_suite():
-from Products.CMFDefault.tests import test_all
-default_tests = test_all
-
-from Products.CMFTopic.tests import test_all
-topic_tests = test_all
-
-try:
- from Products.CMFCalendar.tests import test_all
- calendar_tests = test_all
-except ImportError:
- calendar_tests = None
-
-try:
- from Products.CMFDecor.tests import test_all
- decor_tests = test_all
-except ImportError:
- decor_tests = None
-
-try:
- from Products.DCWorfklow.tests import test_all
- workflow_tests = test_all
-except ImportError:
- workflow_tests = None
-
-
-
-def test_suite():
-
- suite = unittest.TestSuite()
-
- suite.addTest( core_tests.test_suite() )
- suite.addTest( default_tests.test_suite() )
- suite.addTest( topic_tests.test_suite() )
-
- if calendar_tests:
- suite.addTest( calendar_tests.test_suite() )
-
- if decor_tests:
- suite.addTest( decor_tests.test_suite() )
-
- if workflow_tests:
- suite.addTest( workflow_tests.test_suite() )
-
- return suite
-
-def run():
- if hasattr( unittest, 'JUnitTextTestRunner' ):
- unittest.JUnitTextTestRunner().run( test_suite() )
- else:
- unittest.TextTestRunner( verbosity=1 ).run( test_suite() )
+ return TestSuite((
+ build_test_suite('Products.CMFCore.tests',['test_all']),
+ build_test_suite('Products.CMFDefault.tests',['test_all']),
+ build_test_suite('Products.CMFTopic.tests',['test_all']),
+ build_test_suite('Products.CMFCalendar.tests',['test_all'],required=0),
+ build_test_suite('Products.CMFDecor.tests',['test_all'],required=0),
+ build_test_suite('Products.DCWorkflow.tests',['test_all'],required=0),
+ ))
if __name__ == '__main__':
- run()
+ main(defaultTest='test_suite')