[Zope3-checkins] CVS: Zope3/src/zope/interface/tests - test_declarations.py:1.4

Jim Fulton jim@zope.com
Sun, 18 May 2003 13:53:37 -0400


Update of /cvs-repository/Zope3/src/zope/interface/tests
In directory cvs.zope.org:/tmp/cvs-serv8209/src/zope/interface/tests

Modified Files:
	test_declarations.py 
Log Message:
Rewrote the support for running doctest tests as unittests.

Now, there is a function for computing a unittest test suite based on
the doctest tests found in a module.

Added a debugger for doctest tests.  This is needed because the
standard Python debugger won't work with doctest, because doctest
hijacks stdout.

Also added a text extractor that extracts a test script from a doctest
test doc string.  


=== Zope3/src/zope/interface/tests/test_declarations.py 1.3 => 1.4 ===
--- Zope3/src/zope/interface/tests/test_declarations.py:1.3	Tue May 13 15:48:23 2003
+++ Zope3/src/zope/interface/tests/test_declarations.py	Sun May 18 13:53:06 2003
@@ -19,7 +19,7 @@
 
 import unittest
 from zope.interface import *
-from zope.testing.doc import doctest
+from zope.testing.doctestunit import DocTestSuite
 from zope.interface import Interface
 
 class I1(Interface): pass
@@ -50,11 +50,6 @@
     # Note that most of the tests are in the doc strings of the
     # declarations module.
 
-    def test_doctest(self):
-        doctest(self, declarations)
-
-
-
     def test_ObjectSpecification_Simple(self):
         c = C()
         directlyProvides(c, I4)
@@ -161,6 +156,8 @@
 def test_suite():
     suite = unittest.TestSuite()
     suite.addTest(unittest.makeSuite(Test))
+    suite.addTest(DocTestSuite("zope.interface.declarations"))
+    
     return suite