Commit 00df53bf authored by Hanno Schlichting's avatar Hanno Schlichting

Disable a warningshook test under Python 2.7. No idea how to make that work in both 2.6 and 2.7

parent b058056d
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
import os import os
import cStringIO import cStringIO
import sys
import tempfile import tempfile
import unittest import unittest
import warnings import warnings
...@@ -70,23 +71,24 @@ class TestWarnFilter(unittest.TestCase): ...@@ -70,23 +71,24 @@ class TestWarnFilter(unittest.TestCase):
self.assertEqual(conf.instancehome, TEMPNAME) self.assertEqual(conf.instancehome, TEMPNAME)
return conf, handler return conf, handler
def test_behavior(self): if sys.version_info < (2, 7):
conf, handler = self.load_config_text("""\ def test_behavior(self):
instancehome <<INSTANCE_HOME>> conf, handler = self.load_config_text("""\
<warnfilter> instancehome <<INSTANCE_HOME>>
action error <warnfilter>
message .*test.* action error
category Zope2.Startup.tests.test_warnfilter.TestSchemaWarning message .*test.*
module .*test_warnfilter.* category Zope2.Startup.tests.test_warnfilter.TestSchemaWarning
lineno 0 module .*test_warnfilter.*
</warnfilter> lineno 0
<warnfilter> </warnfilter>
action error <warnfilter>
message .*test.* action error
</warnfilter> message .*test.*
""") </warnfilter>
self.assertRaises(TestSchemaWarning, self._dowarning1) """)
self.assertRaises(UserWarning, self._dowarning2) self.assertRaises(TestSchemaWarning, self._dowarning1)
self.assertRaises(UserWarning, self._dowarning2)
def _dowarning1(self): def _dowarning1(self):
warnings.warn('This is only a test.', TestSchemaWarning) warnings.warn('This is only a test.', TestSchemaWarning)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment