From: Stefan H. H. <sh...@us...> - 2005-02-02 22:03:35
|
Update of /cvsroot/collective/ZopeTestCase/doctest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17261 Modified Files: functional.py Log Message: Split FunctionalDocFileSuite into two functions so we can experiment with other (non-functional) types of doctests. Index: functional.py =================================================================== RCS file: /cvsroot/collective/ZopeTestCase/doctest/functional.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- functional.py 30 Jan 2005 14:30:12 -0000 1.5 +++ functional.py 2 Feb 2005 22:03:25 -0000 1.6 @@ -10,6 +10,7 @@ from Testing.ZopeTestCase import Functional from Testing.ZopeTestCase import FunctionalTestCase +from Testing.ZopeTestCase import ZopeTestCase from Testing.ZopeTestCase import user_name from Testing.ZopeTestCase import user_password from Testing.ZopeTestCase.sandbox import AppZapper @@ -193,6 +194,16 @@ name = 'Functional%s' % name test_class = type(name, (Functional, test_class), {}) + kw['globs'] = globs + kw['test_class'] = test_class + return ZopeDocFileSuite(*paths, **kw) + + +def ZopeDocFileSuite(*paths, **kw): + globs = kw.setdefault('globs', {}) + + test_class = kw.get('test_class', ZopeTestCase) + # If the test_class does not have a runTest method, we add # a dummy attribute so that TestCase construction works. if not hasattr(test_class, 'runTest'): @@ -236,5 +247,6 @@ __all__ = [ 'FunctionalDocFileSuite', + 'ZopeDocFileSuite', ] |