[prev in list] [next in list] [prev in thread] [next in thread]
List: zodb-checkins
Subject: [Zodb-checkins] CVS: Zope3/src/zope/testing - doctestunit.py:1.12
From: Garrett Smith <garrett () mojave-corp ! com>
Date: 2004-05-11 11:23:59
Message-ID: 200405111123.i4BBNxxP022888 () cvs ! zope ! org
[Download RAW message or body]
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()
_______________________________________________
Zodb-checkins mailing list
Zodb-checkins@zope.org
http://mail.zope.org/mailman/listinfo/zodb-checkins
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic