Alexander Belopolsky <belopol...@users.sourceforge.net> added the comment:

On Mon, Nov 1, 2010 at 2:13 PM, Raymond Hettinger
<rep...@bugs.python.org> wrote:
..
>
> We don't usually test the content of error messages because they are not a 
> guaranteed behavior.
>
I recall that when I asked about this on #python-dev, someone pointed
to places where content of error messages is tested in python unit
tests.  I also asked whether such tests should be marked as cpython
details, and the answer was know.  Unfortunately I don't remember who
was telling me that, but it sounded reasonable enough that I submitted
the tests.

I think if testing error messages is a grey area, in this case it is
reasonable to have a test for at least two reasons:

1. It was reported as a bug, so users already expect this behavior.

2. There is no prose in the error message, just the key, so it is not
as arbitrary as other error messages.

Note that in my tests I deliberately tested only e.args[0] and not
str(e) or e.args[1:].

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10221>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to