[issue24134] assertRaises can behave differently

Serhiy Storchaka report at bugs.python.org
Wed May 6 16:29:49 CEST 2015


Serhiy Storchaka added the comment:

Updated patch includes tests for the function is None. There were no tests for assertRaises(), the patch adds them, based on tests for assertWarns().

> Why not sentinel = Object()?

Only for better repr in the case the sentinel is leaked. Other variants are to make it named object, such as a function or a class, as Magnus suggested.

----------
Added file: http://bugs.python.org/file39306/assert_raises_sentinel_2.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24134>
_______________________________________


More information about the Python-bugs-list mailing list