[CMF-checkins] CVS: CMF - CHANGES.txt:1.146.4.71 all_cmf_tests.py:1.7.14.2

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


Update of /cvs-repository/CMF
In directory cvs.zope.org:/tmp/cvs-serv21694

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


=== CMF/CHANGES.txt 1.146.4.70 => 1.146.4.71 ===
--- CMF/CHANGES.txt:1.146.4.70	Sun Apr 24 19:40:24 2005
+++ CMF/CHANGES.txt	Mon Apr 25 14:46:27 2005
@@ -12,6 +12,8 @@
       avoid duplicating test runs (which can lead to spurious test failures).
       'bin/zopectl test' from an instance home with CMF installed should now
       run all tests cleanly.  Backport from the 1.5 changes a year back.
+      'bin/zopctl run <path/to>/all_cmf_tests.py' is a deprectated way
+      to run (mostly) the same tests.
 
     - Fixed Creator() to not call a potentially costly method on the
       user folder. (http://zope.org/Collectors/CMF/300)


=== CMF/all_cmf_tests.py 1.7.14.1 => 1.7.14.2 ===
--- CMF/all_cmf_tests.py:1.7.14.1	Sat Mar  6 16:25:11 2004
+++ CMF/all_cmf_tests.py	Mon Apr 25 14:46:27 2005
@@ -1,29 +1,45 @@
-#! /usr/bin/env python
+#!/usr/bin/env python
+
+##############################################################################
+#
+# Copyright (c) 2001 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 tests.
+
+$Id$
+"""
+
 import unittest
+import Testing
+import Zope
+Zope.startup()
+
+import getopt
 import sys
 
+from Products.CMFCore.tests.base.utils import build_test_suite
+
+
 #                  PackageName     Required?
-CMF_PACKAGES = [ ( 'CMFCore',       1 )
-               , ( 'CMFDefault',    1 )
-               , ( 'CMFTopic',      1 )
-               , ( 'CMFCalendar',   0 )
-               , ( 'DCWorkflow',    1 )
+CMF_PACKAGES = [ ( 'CMFCore',        1 )
+               , ( 'CMFDefault',     1 )
+               , ( 'CMFTopic',       1 )
+               , ( 'CMFCalendar',    0 )
+               , ( 'DCWorkflow',     1 )
                ]
 
 PACKAGES_UNDER_TEST = []
 
 def test_suite():
 
-    import Testing
-    import Zope
-
-    try:
-        Zope.startup()
-    except AttributeError:  # Zope <= 2.6.0
-        pass
-
-    from Products.CMFCore.tests.base.utils import build_test_suite
-
     suite = unittest.TestSuite()
 
     packages = PACKAGES_UNDER_TEST or CMF_PACKAGES
@@ -33,6 +49,7 @@
         suite.addTest( build_test_suite( dotted
                                        , [ 'test_all' ]
                                        , required=required
+                                       , suite_name='suite'
                                        ) )
 
     return suite
@@ -53,8 +70,6 @@
 
 def main():
 
-    import getopt
-
     try:
         opts, args = getopt.getopt( sys.argv[1:], 'vq?' )
     except getopt.GetoptError:
@@ -76,6 +91,11 @@
 
     unittest.main(defaultTest='test_suite')
 
-if __name__ == '__main__':
 
+if __name__ == '__main__':
+    from warnings import warn
+    warn("'all_cmf_tests' is a deprecated mode for running CMF tests, "
+         "for backward compatibility with Zope 2.6.x.  It is not present "
+         "in CMF >= 1.5.  The preferred mode is to use 'bin/zopectl test' "
+         "from within your $INSTANCE_HOME", DeprecationWarning)
     main()



More information about the CMF-checkins mailing list