[CMF-checkins] CVS: Products/CMFCore/tests/base - utils.py:1.2.44.3

Tres Seaver tseaver at zope.com
Mon Apr 25 14:46:28 EDT 2005


Update of /cvs-repository/Products/CMFCore/tests/base
In directory cvs.zope.org:/tmp/cvs-serv21694/CMFCore/tests/base

Modified Files:
      Tag: CMF-1_4-branch
	utils.py 
Log Message:
 - Make deprecated 'all_cmf_tests' work properly FBO Zope 2.6 users.


=== Products/CMFCore/tests/base/utils.py 1.2.44.2 => 1.2.44.3 ===
--- Products/CMFCore/tests/base/utils.py:1.2.44.2	Fri Apr 23 17:11:36 2004
+++ Products/CMFCore/tests/base/utils.py	Mon Apr 25 14:46:28 2005
@@ -1,22 +1,42 @@
+##############################################################################
+#
+# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+""" CMF test utils.
+
+$Id$
+"""
+
 from unittest import TestSuite
+
 from sys import modules
 
-def build_test_suite(package_name,module_names,required=1):
+
+def build_test_suite(package_name, module_names, required=1,
+                     suite_name='test_suite'):
     """
     Utlitity for building a test suite from a package name
     and a list of modules.
-    
+
     If required is false, then ImportErrors will simply result
     in that module's tests not being added to the returned
     suite.
     """
-    
+
     suite = TestSuite()
     try:
         for name in module_names:
             the_name = package_name+'.'+name
             __import__(the_name,globals(),locals())
-            suite.addTest(modules[the_name].test_suite())
+            suite.addTest( getattr(modules[the_name], suite_name)() )
     except ImportError:
         if required:
             raise
@@ -33,4 +53,3 @@
         if catalog.getpath( rid ) == path:
             return 1
     return 0
-



More information about the CMF-checkins mailing list