doctest and Python 2.1 (was RE: [Python-Dev] Unit testing (again))

Peter Funk pf@artcom-gmbh.de
Tue, 13 Feb 2001 08:17:03 +0100 (MET)


Hi,

Tim Peters:
> Note that doctest.py is part of the 2.1 std library.  If you've never used
[...]
> I will immodestly claim that if doctest is sufficient for your testing
> purposes, you're never going to find anything easier or faster or more
> natural to use (and, yes, if an unexpected exception is raised, it doesn't
> stop the rest of the tests from running -- it's in the very nature of "unit
> tests" that an error in one unit should not prevent other unit tests from
> running).
> 
> practicing-for-a-marketing-career-ly y'rs  - tim

[a satisfied customer reports:]
I like doctest very much.  I'm using it for our company projects a lot.
This is a very valuable tool.

However Pings latest changes, which turned 'foobar\012' into 'foobar\n'
and '\377\376\345' into '\xff\xfe\xe5' has broken some of the doctests
in our software.  

Since we have to keep our code compatible with Python 1.5.2 for at
least one, two or may be three more years, it isn't obvious to me
how to fix this.

I've spend some thoughts about a patch to doctest fooling the string
printing output back to the 1.5.2 behaviour, but didn't get around
to it until now.  :-(

Regards, Peter
-- 
Peter Funk, Oldenburger Str.86, D-27777 Ganderkesee, Germany, Fax:+49 4222950260
office: +49 421 20419-0 (ArtCom GmbH, Grazer Str.8, D-28359 Bremen)