summaryrefslogtreecommitdiff
path: root/Lib/unittest/case.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-02-07 17:02:22 +0000
committerGeorg Brandl <georg@python.org>2010-02-07 17:02:22 +0000
commitdc3694bee021480980d5b66a93f69ce137ee5be4 (patch)
tree5b4700577b3764372ae965ba32c23de2b65f7fe8 /Lib/unittest/case.py
parent4ad752d70f211dc24ef96474d266005d08c35923 (diff)
downloadcpython-git-dc3694bee021480980d5b66a93f69ce137ee5be4.tar.gz
Rename "exc_value" attribute on assertRaises context manager to "exception".
Diffstat (limited to 'Lib/unittest/case.py')
-rw-r--r--Lib/unittest/case.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py
index 854ebc4023..63408e35ac 100644
--- a/Lib/unittest/case.py
+++ b/Lib/unittest/case.py
@@ -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)