]> granicus.if.org Git - python/commitdiff
Rolled back revisions 74556 via svnmerge from
authorBenjamin Peterson <benjamin@python.org>
Sat, 10 Oct 2009 21:27:03 +0000 (21:27 +0000)
committerBenjamin Peterson <benjamin@python.org>
Sat, 10 Oct 2009 21:27:03 +0000 (21:27 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

Doc/library/unittest.rst
Lib/test/test_unittest.py
Lib/unittest/case.py

index aa763086bffbc16a539bba2a2289704f0fa2d410..984ec272dadcce27e383a75f509f6cb463fdeceb 100644 (file)
@@ -891,10 +891,6 @@ Test cases
          with self.failUnlessRaises(some_error_class):
              do_something()
 
-      The context manager will store the caught exception object in its
-      :attr:`exc_value` attribute.  This can be useful if the intention
-      is to perform additional checks on the exception raised.
-
       .. versionchanged:: 3.1
          Added the ability to use :meth:`assertRaises` as a context manager.
 
index 120a90d759cadc0f611bc9c1ab2637babebf8129..040880ad028f882f692973d0b0339ac606208fd6 100644 (file)
@@ -2846,21 +2846,6 @@ test case
                 self.assertRaisesRegexp, Exception,
                 re.compile('^Expected$'), Stub)
 
-    def testAssertRaisesExcValue(self):
-        class ExceptionMock(Exception):
-            pass
-
-        def Stub(foo):
-            raise ExceptionMock(foo)
-        v = "particular value"
-
-        ctx = self.assertRaises(ExceptionMock)
-        with ctx:
-            Stub(v)
-        e = ctx.exc_value
-        self.assertTrue(isinstance(e, ExceptionMock))
-        self.assertEqual(e.args[0], v)
-
     def testSynonymAssertMethodNames(self):
         """Test undocumented method name synonyms.
 
index 88254be68b4e0538c7f37586d8c18e2832f3248a..79c4a7255b1d13b9952508a6abf746366532dd7c 100644 (file)
@@ -116,7 +116,6 @@ 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
         if self.expected_regex is None:
             return True