Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 676161a

Browse files
committed
Rolled back revisions 74556 via svnmerge from
svn+ssh://[email protected]/python/trunk
1 parent 38c34ef commit 676161a

3 files changed

Lines changed: 0 additions & 20 deletions

File tree

Doc/library/unittest.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -891,10 +891,6 @@ Test cases
891891
with self.failUnlessRaises(some_error_class):
892892
do_something()
893893

894-
The context manager will store the caught exception object in its
895-
:attr:`exc_value` attribute. This can be useful if the intention
896-
is to perform additional checks on the exception raised.
897-
898894
.. versionchanged:: 3.1
899895
Added the ability to use :meth:`assertRaises` as a context manager.
900896

Lib/test/test_unittest.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2846,21 +2846,6 @@ def Stub():
28462846
self.assertRaisesRegexp, Exception,
28472847
re.compile('^Expected$'), Stub)
28482848

2849-
def testAssertRaisesExcValue(self):
2850-
class ExceptionMock(Exception):
2851-
pass
2852-
2853-
def Stub(foo):
2854-
raise ExceptionMock(foo)
2855-
v = "particular value"
2856-
2857-
ctx = self.assertRaises(ExceptionMock)
2858-
with ctx:
2859-
Stub(v)
2860-
e = ctx.exc_value
2861-
self.assertTrue(isinstance(e, ExceptionMock))
2862-
self.assertEqual(e.args[0], v)
2863-
28642849
def testSynonymAssertMethodNames(self):
28652850
"""Test undocumented method name synonyms.
28662851

Lib/unittest/case.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ def __exit__(self, exc_type, exc_value, tb):
116116
if not issubclass(exc_type, self.expected):
117117
# let unexpected exceptions pass through
118118
return False
119-
self.exc_value = exc_value #store for later retrieval
120119
if self.expected_regex is None:
121120
return True
122121

0 commit comments

Comments
 (0)