Rename "exc_value" attribute on assertRaises context manager to "exception".

This commit is contained in:
Georg Brandl 2010-02-07 17:02:22 +00:00
parent 4ad752d70f
commit dc3694bee0
3 changed files with 5 additions and 13 deletions

View file

@ -104,7 +104,7 @@ class _AssertRaisesContext(object):
if not issubclass(exc_type, self.expected):
# let unexpected exceptions pass through
return False
self.exc_value = exc_value #store for later retrieval
self.exception = exc_value # store for later retrieval
if self.expected_regexp is None:
return True
@ -389,7 +389,7 @@ class TestCase(object):
with self.assertRaises(SomeException) as cm:
do_something()
the_exception = cm.exc_value
the_exception = cm.exception
self.assertEqual(the_exception.error_code, 3)
"""
context = _AssertRaisesContext(excClass, self)