[New-bugs-announce] [issue9736] doctest.DocTestSuite doesn't handle test globs correctly

Jim Fulton report at bugs.python.org
Wed Sep 1 21:01:14 CEST 2010

New submission from Jim Fulton <jim at zope.com>:

We often run test suites repeatedly using a debug build of python
to look for memory leaks.

We also got in the bad habit of using a fork of doctest. Recently, we've switched away from our fork and have noticed a problem with the standard doctest's handling of test globs (globals).

DocTestSuite gets an initial set of globals from the module the doctest's came from.  After running the tests, it seems to clear these, leading to errors if the tests are run again.

I've attached a script that illustrates the problem.  The script runs a simple test twice and gets a spurious failure the second time.

components: Library (Lib)
files: doctest_DocTestSuite_globs_breakage.py
messages: 115326
nosy: j1m
priority: normal
severity: normal
status: open
title: doctest.DocTestSuite doesn't handle test globs correctly
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1
Added file: http://bugs.python.org/file18704/doctest_DocTestSuite_globs_breakage.py

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list