very puzzling doctest behaviour

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon Dec 17 22:53:33 EST 2007


En Mon, 17 Dec 2007 21:29:55 -0300, André <andre.roberge 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.

-- 
Gabriel Genellina




More information about the Python-list mailing list