Oops, sorry, I made an error in the original description of the problem (test 4 & 5 below)
On Dec 17, 8:25 pm, "André" <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I've run into a very puzzling doctest behaviour - I'm trying to narrow > down the case of it but I'm dealing with multiple files being imported > for one of the case and I have not, so far, created a simple example. > However, just in case someone had run into something similar, I > thought I would ask. > > I am using the doctest.testfile() interface to load up tests that > resides in a text file. Here's a description of the puzzling feature. > > ==== file 1: all tests pass ==== > title > >>> print "<" > < > >>> import module_a > >>> print "<" > < > ======================== > > So far, nothing surprising... > > ==== file 2: we have a failure ==== > title > >>> print "<" > < > >>> import module_a > >>> print "<" > < > > + 400 lines of text and further tests > ======================== > The second expected "<" fails; instead, we get "<" > > ==== file 3: all tests pass ==== > title > >>> print "<" > < > >>> import module_a > >>> print "<" > < > > + 400 lines of text and further tests > ======================== > > Upon further inspection, I find in module_a that, if I comment out a > line like > import module_b > then, tests in file 2 pass again. So, I figure the problem is in > module_b. > I then did > Sorry, file 4 had NO failure ... so it looked like the problem was NOT in module_b; and yet, when I commented its import in module_a, the problem went away. > ==== file 4: one failure ==== > title > >>> print "<" > < > >>> import module_b > >>> print "<" > < > > + 400 lines of text and further tests > ======================== > > > As mentioned, I have not succeeded in narrowing it down further. > However, has anyone observed such a behaviour of doctests before? > > André -- http://mail.python.org/mailman/listinfo/python-list