Fix assert_raises for catching parents of exceptions.
This commit is contained in:
parent
2bf85fe25d
commit
82bc502cf7
@ -27,6 +27,8 @@ except TypeError:
|
|||||||
|
|
||||||
def __exit__(self, exc_type, exc_val, tb):
|
def __exit__(self, exc_type, exc_val, tb):
|
||||||
self.exception = exc_val
|
self.exception = exc_val
|
||||||
|
if issubclass(exc_type, self.expected):
|
||||||
|
return True
|
||||||
nose.tools.assert_equal(exc_type, self.expected)
|
nose.tools.assert_equal(exc_type, self.expected)
|
||||||
# if you get to this line, the last assertion must have passed
|
# if you get to this line, the last assertion must have passed
|
||||||
# suppress the propagation of this exception
|
# suppress the propagation of this exception
|
||||||
|
Loading…
Reference in New Issue
Block a user