[Zope3-checkins] SVN: Zope3/branches/jim-adapter/src/zope/app/component/tests/test_registration.py Turn off warnings when testing deprecated apis.

Jim Fulton jim at zope.com
Sat Apr 22 14:53:27 EDT 2006


Log message for revision 67276:
  Turn off warnings when testing deprecated apis.
  

Changed:
  U   Zope3/branches/jim-adapter/src/zope/app/component/tests/test_registration.py

-=-
Modified: Zope3/branches/jim-adapter/src/zope/app/component/tests/test_registration.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/tests/test_registration.py	2006-04-22 18:53:22 UTC (rev 67275)
+++ Zope3/branches/jim-adapter/src/zope/app/component/tests/test_registration.py	2006-04-22 18:53:25 UTC (rev 67276)
@@ -16,7 +16,9 @@
 $Id$
 """
 __docformat__ = "reStructuredText"
+
 import unittest
+import warnings
 
 import zope.component.testing as placelesssetup
 from zope.testing import doctest
@@ -27,12 +29,18 @@
     setup.setUpAnnotations()
     setup.setUpDependable()
     setup.setUpTraversal()
+    test.globs['showwarning'] = warnings.showwarning
+    warnings.showwarning = lambda *a, **k: None
 
+def tearDown(test):
+    warnings.showwarning = test.globs['showwarning']
+    placelesssetup.tearDown(test)
+
 def test_suite():
     suite = unittest.TestSuite((
-        doctest.DocFileSuite('deprecated35_statusproperty.txt'),
-        doctest.DocFileSuite('deprecated35_registration.txt',
-                             setUp=setUp, tearDown=placelesssetup.tearDown),
+        doctest.DocFileSuite('deprecated35_statusproperty.txt',
+                             'deprecated35_registration.txt',
+                             setUp=setUp, tearDown=tearDown),
         ))
     suite.level = 2
     return suite



More information about the Zope3-Checkins mailing list