[Zope3-checkins] SVN: Zope3/branches/philikon-reduce-zcml/src/zope/app/component/tests/test_directives.py ignore BBB warnings during unittests

Philipp von Weitershausen philikon at philikon.de
Wed Mar 15 08:52:34 EST 2006


Log message for revision 66030:
  ignore BBB warnings during unittests
  

Changed:
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/component/tests/test_directives.py

-=-
Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/component/tests/test_directives.py
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/component/tests/test_directives.py	2006-03-15 13:44:10 UTC (rev 66029)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/component/tests/test_directives.py	2006-03-15 13:52:33 UTC (rev 66030)
@@ -18,6 +18,7 @@
 import re
 import unittest
 import pprint
+import warnings
 from cStringIO import StringIO
 
 from zope.interface import Interface, implements
@@ -1366,8 +1367,11 @@
             ))
         self.assertRaises(ValueError, xmlconfig, config, testing=1)
 
+    # BBB 2006/02/24, to be removed after 12 months
     def testFactory(self):
-
+        def ignorewarning(message, category, filename, lineno, file=None):
+            pass
+        warnings.showwarning = ignorewarning
         self.assertRaises(ComponentLookupError, zapi.createObject, 'foo')
 
         xmlconfig(StringIO(template % (
@@ -1382,6 +1386,7 @@
         from factory import X
         self.assertEqual(zapi.createObject('foo.bar').__class__, X)
 
+        warnings.resetwarnings()
 
 class ParticipationStub(object):
 



More information about the Zope3-Checkins mailing list