[Python-Dev] Unit testing (again)
Tim Peters
tim.one@home.com
Tue, 13 Feb 2001 16:39:08 -0500
[/F]
> which reminds me... are there any chance of getting a doctest
> that can survives its own test suite under 1.5.2, 2.0, and 2.1?
>
> the latest version blows up under 1.5.2 and 2.0:
>
> *****************************************************************
> Failure in example: 1/0
> from line #155 of doctest
> Expected: ZeroDivisionError: integer division or modulo by zero
> Got: ZeroDivisionError: integer division or modulo
> 1 items had failures:
> 1 of 8 in doctest
> ***Test Failed*** 1 failures.
Not to my mind. doctest is intentionally picky about exact matches, for
reasons explained earlier. If the docs for a thing say "integer division or
modulo by zero" is expected, but running it says something else, the docs
are wrong and doctest's primary *purpose* is to point that out loudly.
I could change the exception example to something where Python didn't
gratuitously change what it prints, though <wink>. OK, I'll do that.