[Zope3-checkins] SVN: zope.testing/trunk/ Suppress zope.testing.doctest deprecation warning when running

Marius Gedminas marius at pov.lt
Thu Mar 25 12:08:52 EDT 2010


Log message for revision 110180:
  Suppress zope.testing.doctest deprecation warning when running
  zope.testing's own test suite.
  
  

Changed:
  U   zope.testing/trunk/CHANGES.txt
  U   zope.testing/trunk/src/zope/testing/tests.py

-=-
Modified: zope.testing/trunk/CHANGES.txt
===================================================================
--- zope.testing/trunk/CHANGES.txt	2010-03-25 16:05:54 UTC (rev 110179)
+++ zope.testing/trunk/CHANGES.txt	2010-03-25 16:08:52 UTC (rev 110180)
@@ -9,7 +9,10 @@
 
 - Fix testrunner-layers-ntd.txt to suppress output to sys.stderr.
 
+- Suppress zope.testing.doctest deprecation warning when running
+  zope.testing's own test suite.
 
+
 3.9.2 (2010-03-15)
 ==================
 

Modified: zope.testing/trunk/src/zope/testing/tests.py
===================================================================
--- zope.testing/trunk/src/zope/testing/tests.py	2010-03-25 16:05:54 UTC (rev 110179)
+++ zope.testing/trunk/src/zope/testing/tests.py	2010-03-25 16:08:52 UTC (rev 110180)
@@ -1,6 +1,4 @@
 ##############################################################################
-#
-# Copyright (c) 2004 Zope Corporation and Contributors.
 # All Rights Reserved.
 #
 # This software is subject to the provisions of the Zope Public License,
@@ -18,8 +16,16 @@
 
 import re
 import unittest
-from zope.testing import doctest, renormalizing
+import warnings
+from zope.testing import renormalizing
 
+# Yes, it is deprecated, but we want to run tests on it here.
+warnings.filterwarnings("ignore", "zope.testing.doctest is deprecated",
+                        DeprecationWarning, __name__, 0)
+
+from zope.testing import doctest
+
+
 def test_suite():
     return unittest.TestSuite((
         doctest.DocTestSuite('zope.testing.loggingsupport'),



More information about the Zope3-Checkins mailing list