classification
Title: doctest.DocTestSuite doesn't handle test globs correctly
Type: behavior Stage: needs patch
Components: Library (Lib) Versions: Python 3.2, Python 3.1, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: eric.araujo, j1m
Priority: normal Keywords:

Created on 2010-09-01 19:01 by j1m, last changed 2010-11-02 22:52 by j1m.

Files
File name Uploaded Description Edit
doctest_DocTestSuite_globs_breakage.py j1m, 2010-09-01 19:01
Messages (3)
msg115326 - (view) Author: Jim Fulton (j1m) * (Python committer) Date: 2010-09-01 19:01
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.
msg120260 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-11-02 21:55
Would you like to work on a patch?

(Setting the versions field to versions that are open for bug fixes.)
msg120277 - (view) Author: Jim Fulton (j1m) * (Python committer) Date: 2010-11-02 22:52
On Tue, Nov 2, 2010 at 5:55 PM, Éric Araujo <report@bugs.python.org> wrote:
>
> Éric Araujo <merwok@netwok.org> added the comment:
>
> Would you like to work on a patch?

Sure.

Jim
History
Date User Action Args
2010-11-02 22:52:29j1msetmessages: + msg120277
2010-11-02 21:55:05eric.araujosetversions: + Python 3.2, - Python 2.6, Python 2.5
nosy: + eric.araujo

messages: + msg120260

type: behavior
stage: needs patch
2010-09-01 19:01:13j1mcreate