repeating doctest runs breaks with stdlib doctest

Bug #628300 reported by Jim Fulton
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zope.testrunner
Invalid
Undecided
Unassigned

Bug Description

The standard library doctest.DocTestSuite doesn't handle running the suite multiple times properly.

  http://bugs.python.org/issue9736

I think we can (and therefore should) work around this by rebuilding the test suites each time we
run the tests.

Revision history for this message
Marius Gedminas (mgedmin) wrote :

I've used the following monkey-patch in one project to make --repeat work with stdlib's doctest:

    import doctest
    orig_init = doctest.DocTestCase.__init__
    def fixed_init(self, *args, **kw):
        orig_init(self, *args, **kw)
        self._dt_globs_copy = self._dt_test.globs.copy()
    orig_tearDown = doctest.DocTestCase.tearDown
    def fixed_tearDown(self):
        orig_tearDown(self)
        self._dt_test.globs.update(self._dt_globs_copy)
    doctest.DocTestCase.__init__ = fixed_init
    doctest.DocTestCase.tearDown = fixed_tearDown

Revision history for this message
Colin Watson (cjwatson) wrote :

The zope.testrunner project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/zope.testrunner.

Changed in zope.testrunner:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.