[issue24134] assertRaises can behave differently

2015-05-06 Thread Magnus Carlsson
New submission from Magnus Carlsson: Hi I have a little issue with the current assertRaises implementation. It seems that it might produce a little different results depending on how you use it. self.assertRaises(IOError, None) will not produce the same result as: with self.assertRaises

[issue24134] assertRaises can behave differently

2015-05-06 Thread Magnus Carlsson
Magnus Carlsson added the comment: The solution to that is to always have a test that your decorator actually returns a function. That's what I do. Yes, I agree that with more tests I would have found the problem, but sometimes you forget things. And to me I want the tests to fail by default