This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.araujo
Recipients eric.araujo, ezio.melotti, petri.lehtinen
Date 2011-11-07.16:48:59
SpamBayes Score 1.9601225e-07
Marked as misclassified No
Message-id <1320684540.52.0.651465901829.issue13349@psf.upfronthosting.co.za>
In-reply-to
Content
> There's also documentation and tests that depend on this actual error message:
> Doc/library/doctest.rst:   ValueError: list.remove(x): x not in list
> Lib/test>/test_xml_etree.py:    ValueError: list.remove(x): x not in list
That’s a well-known doctest problem.  Just update the doc.  Writing robust doctests is an art:

>>> str(someobject)
'output that can change'
>>> 'something I want' in str(someobject)  # more robust, but less useful if it fails
True

>>> something.index(spam)
traceback blah:
ValueError: output that can change
>>> try: something.index(spam)
... except ValueError: print('spam not in something')  # more robust, but ugly
spam not in something
History
Date User Action Args
2011-11-07 16:49:00eric.araujosetrecipients: + eric.araujo, ezio.melotti, petri.lehtinen
2011-11-07 16:49:00eric.araujosetmessageid: <1320684540.52.0.651465901829.issue13349@psf.upfronthosting.co.za>
2011-11-07 16:48:59eric.araujolinkissue13349 messages
2011-11-07 16:48:59eric.araujocreate