[issue2604] doctest.DocTestCase fails when run repeatedly

James Henstridge report at bugs.python.org
Fri Apr 11 08:26:22 CEST 2008


James Henstridge <james at jamesh.id.au> added the comment:

Is repeating a test with the same TestCase instance ever safe?  It'd be
better to create a new instance and run that.

If any of the variables in test.globs are changed by the test (e.g.
appending to a list), then rerunning the test will not necessarily give
the same result.

While the zope change allows tests that have immutable globals or don't
change their globals to function, it also lets other tests "almost"
work, and could lead to new bugs that are difficult to track down.

----------
nosy: +jamesh

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2604>
__________________________________


More information about the Python-bugs-list mailing list