[Python-Dev] Deprecate doctest?

Aahz aahz@pythoncraft.com
Sat, 14 Dec 2002 14:42:15 -0500


On Sat, Dec 14, 2002, M.-A. Lemburg wrote:
> David Goodger wrote:
>>
>>This backport checkin (Oct 5 2002) changed the exception text between
>>2.2.1:
>>
>>    >>> int(None)
>>    Traceback (most recent call last):
>>      File "<stdin>", line 1, in ?
>>    TypeError: object can't be converted to int
>>
>>and 2.2.2 (last line):
>>
>>    >>> int(None)
>>    Traceback (most recent call last):
>>      File "<stdin>", line 1, in ?
>>    TypeError: int() argument must be a string or a number
>>
>>Should this change have been backported to 2.2.2 from the 2.3
>>codebase?
>>
>>Patrick O'Brien brought this to my attention.  He found a test in the
>>Docutils test suite that broke under 2.2.2. 
> 
> How can a test break when you change the error message text ? I'd
> say that the test was broken: you should never rely on a particular
> message text since these can and do change rather often.

That's tricky, given that doctest is in the standard library, and that's
exactly what doctest does.  Are you advocating deprecating doctest?
-- 
Aahz (aahz@pythoncraft.com)           <*>         http://www.pythoncraft.com/

"To me vi is Zen.  To use vi is to practice zen.  Every command is a
koan.  Profound to the user, unintelligible to the uninitiated.  You
discover truth everytime you use it."  --reddy@lion.austin.ibm.com