[issue24134] assertRaises can behave differently

Steven D'Aprano report at bugs.python.org
Wed May 6 14:40:11 CEST 2015


Steven D'Aprano added the comment:

I don't think this is a bug. I think it is just a case that you have to be careful when calling functions, you actually do call the function. And that it returns what you think it does.

I think the critical point is this:

"It turned our that I forgot to return the decorator and instead got the default None. But my tests didn't warn me about that."

The solution to that is to always have a test that your decorator actually returns a function. That's what I do.

----------
nosy: +steven.daprano

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


More information about the Python-bugs-list mailing list