very puzzling doctest behaviour

André andre.roberge at gmail.com
Mon Dec 17 22:59:58 EST 2007


On Dec 17, 11:53 pm, "Gabriel Genellina" <gagsl-... at yahoo.com.ar>
wrote:
> En Mon, 17 Dec 2007 21:29:55 -0300, André <andre.robe... at gmail.com>
> escribió:
>
> >> 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.
>
> >> 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
> >> ========================
>
> Are you playing with sys.stdout, replacing it with another object, or
> changing its encoding? That's the only way to get "<" when printing "<"
> that I can think of.
>
Hmmm, yes I do, somewhere (locally I thought) in a function embedded
in yet another module.   This gives me something to look for.

Thanks for the suggestion.

André


> --
> Gabriel Genellina




More information about the Python-list mailing list