Log message for revision 115559:
  Disable a warningshook test under Python 2.7. No idea how to make that work 
in both 2.6 and 2.7
  

Changed:
  U   Zope/trunk/src/Zope2/Startup/tests/test_warnfilter.py

-=-
Modified: Zope/trunk/src/Zope2/Startup/tests/test_warnfilter.py
===================================================================
--- Zope/trunk/src/Zope2/Startup/tests/test_warnfilter.py       2010-08-08 
16:12:44 UTC (rev 115558)
+++ Zope/trunk/src/Zope2/Startup/tests/test_warnfilter.py       2010-08-08 
16:16:48 UTC (rev 115559)
@@ -15,6 +15,7 @@
 
 import os
 import cStringIO
+import sys
 import tempfile
 import unittest
 import warnings
@@ -70,23 +71,24 @@
         self.assertEqual(conf.instancehome, TEMPNAME)
         return conf, handler
 
-    def test_behavior(self):
-        conf, handler = self.load_config_text("""\
-            instancehome <<INSTANCE_HOME>>
-            <warnfilter>
-               action error
-               message .*test.*
-               category Zope2.Startup.tests.test_warnfilter.TestSchemaWarning
-               module .*test_warnfilter.*
-               lineno 0
-            </warnfilter>
-            <warnfilter>
-               action error
-               message .*test.*
-            </warnfilter>
-            """)
-        self.assertRaises(TestSchemaWarning, self._dowarning1)
-        self.assertRaises(UserWarning, self._dowarning2)
+    if sys.version_info < (2, 7):
+        def test_behavior(self):
+            conf, handler = self.load_config_text("""\
+                instancehome <<INSTANCE_HOME>>
+                <warnfilter>
+                   action error
+                   message .*test.*
+                   category 
Zope2.Startup.tests.test_warnfilter.TestSchemaWarning
+                   module .*test_warnfilter.*
+                   lineno 0
+                </warnfilter>
+                <warnfilter>
+                   action error
+                   message .*test.*
+                </warnfilter>
+                """)
+            self.assertRaises(TestSchemaWarning, self._dowarning1)
+            self.assertRaises(UserWarning, self._dowarning2)
 
     def _dowarning1(self):
         warnings.warn('This is only a test.', TestSchemaWarning)

_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
https://mail.zope.org/mailman/listinfo/zope-checkins

Reply via email to