--- doctest.py 2006-07-12 16:02:56.633782400 +0800 +++ doctest.py 2006-07-12 16:05:51.545292800 +0800 @@ -2059,7 +2059,7 @@ class DocTestCase(unittest.TestCase): def __init__(self, test, optionflags=0, setUp=None, tearDown=None, - checker=None): + checker=None, runner=DocTestRunner): unittest.TestCase.__init__(self) self._dt_optionflags = optionflags @@ -2067,6 +2067,7 @@ self._dt_test = test self._dt_setUp = setUp self._dt_tearDown = tearDown + self._dt_runner = runner def setUp(self): test = self._dt_test @@ -2093,8 +2094,8 @@ # so add the default reporting flags optionflags |= _unittest_reportflags - runner = DocTestRunner(optionflags=optionflags, - checker=self._dt_checker, verbose=False) + runner = self._dt_runner(optionflags=optionflags, + checker=self._dt_checker, verbose=False) try: runner.DIVIDER = "-"*70 @@ -2203,7 +2204,7 @@ return "Doctest: " + self._dt_test.name def DocTestSuite(module=None, globs=None, extraglobs=None, test_finder=None, - **options): + test_class=DocTestCase, **options): """ Convert doctest tests for a module to a unittest test suite. @@ -2261,7 +2262,7 @@ if filename[-4:] in (".pyc", ".pyo"): filename = filename[:-1] test.filename = filename - suite.addTest(DocTestCase(test, **options)) + suite.addTest(test_class(test, **options)) return suite