[Checkins] SVN: z3c.template/trunk/ - Using Python's ``doctest`` module instead of depreacted

Michael Howitz mh at gocept.com
Fri Oct 29 02:35:27 EDT 2010


Log message for revision 118013:
  - Using Python's ``doctest`` module instead of depreacted
    ``zope.testing.doctest``.
  

Changed:
  U   z3c.template/trunk/CHANGES.txt
  U   z3c.template/trunk/src/z3c/template/tests.py

-=-
Modified: z3c.template/trunk/CHANGES.txt
===================================================================
--- z3c.template/trunk/CHANGES.txt	2010-10-29 06:30:15 UTC (rev 118012)
+++ z3c.template/trunk/CHANGES.txt	2010-10-29 06:35:27 UTC (rev 118013)
@@ -5,9 +5,9 @@
 1.2.2 (unreleased)
 ------------------
 
-- Nothing changed yet.
+- Using Python's ``doctest`` module instead of depreacted
+  ``zope.testing.doctest``.
 
-
 1.2.1 (2009-08-22)
 ------------------
 

Modified: z3c.template/trunk/src/z3c/template/tests.py
===================================================================
--- z3c.template/trunk/src/z3c/template/tests.py	2010-10-29 06:30:15 UTC (rev 118012)
+++ z3c.template/trunk/src/z3c/template/tests.py	2010-10-29 06:35:27 UTC (rev 118013)
@@ -16,13 +16,11 @@
 """
 __docformat__ = "reStructuredText"
 
-import unittest
-import itertools
-
-from zope.testing import doctest
-from zope.testing.doctestunit import DocFileSuite
 from zope.app.testing import setup
 from zope.configuration import xmlconfig
+import doctest
+import itertools
+import unittest
 
 import z3c.ptcompat
 from z3c.ptcompat.testing import OutputChecker
@@ -37,7 +35,7 @@
 def setUpZPT(suite):
     z3c.ptcompat.config.disable()
     setUp(suite)
-    
+
 def setUpZ3CPT(suite):
     z3c.ptcompat.config.enable()
     setUp(suite)
@@ -46,18 +44,15 @@
 def test_suite():
     checker = OutputChecker(doctest)
     tests = ((
-        DocFileSuite('README.txt',
+        doctest.DocFileSuite('README.txt',
             setUp=setUp, tearDown=tearDown,
             optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
             checker=checker,
             ),
-        DocFileSuite('zcml.txt', setUp=setUp, tearDown=tearDown,
+        doctest.DocFileSuite('zcml.txt', setUp=setUp, tearDown=tearDown,
             optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
             checker=checker,
             ),
         ) for setUp in (setUpZPT, setUpZ3CPT,))
 
     return unittest.TestSuite(itertools.chain(*tests))
-
-if __name__ == '__main__':
-    unittest.main(defaultTest='test_suite')



More information about the checkins mailing list