Fix assert_raises for catching parents of exceptions.
This commit is contained in:
parent
2bf85fe25d
commit
82bc502cf7
1 changed files with 2 additions and 0 deletions
|
|
@ -27,6 +27,8 @@ except TypeError:
|
|||
|
||||
def __exit__(self, exc_type, exc_val, tb):
|
||||
self.exception = exc_val
|
||||
if issubclass(exc_type, self.expected):
|
||||
return True
|
||||
nose.tools.assert_equal(exc_type, self.expected)
|
||||
# if you get to this line, the last assertion must have passed
|
||||
# suppress the propagation of this exception
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue