[Zodb-checkins] CVS: Zope3/src/zope/testing - doctestunit.py:1.12

Garrett Smith garrett at mojave-corp.com
Tue May 11 07:23:59 EDT 2004


Update of /cvs-repository/Zope3/src/zope/testing
In directory cvs.zope.org:/tmp/cvs-serv22860/src/zope/testing

Modified Files:
	doctestunit.py 
Log Message:
Update to DocFileSuite to accept a 'package' arg -- enables use of this
function outside of it's package.


=== Zope3/src/zope/testing/doctestunit.py 1.11 => 1.12 ===
--- Zope3/src/zope/testing/doctestunit.py:1.11	Fri Apr  2 07:53:05 2004
+++ Zope3/src/zope/testing/doctestunit.py	Tue May 11 07:23:58 2004
@@ -87,7 +87,15 @@
     def shortDescription(self):
         return "Doctest: " + self.__name
 
-def DocFileSuite(*paths):
+def DocFileSuite(package, *paths):
+    """Creates a suite of doctest files.
+    
+    package is the source package containing the doctest files.
+    
+    Each subsequent argument is a string specifying the file name of the
+    doctest relative to the package.
+    """
+    
     # It's not entirely obvious how to connection this single string
     # with unittest.  For now, re-use the _utest() function that comes
     # standard with doctest in Python 2.3.  One problem is that the
@@ -96,7 +104,7 @@
     import os, doctest, new
     t = doctest.Tester(globs={})
     suite = unittest.TestSuite()
-    dir = os.path.split(__file__)[0]
+    dir = os.path.split(package.__file__)[0]
     for path in paths:
         path = os.path.join(dir, path)
         source = open(path).read()




More information about the Zodb-checkins mailing list