@@ -16,26 +16,26 @@ def assertRaises( # type: ignore[override]
1616 ):
1717 # type: (...) -> Any
1818 """Fail unless an exception of class expected_exception is raised
19- by callableObj when invoked with arguments args and keyword
20- arguments kwargs. If a different type of exception is
21- raised, it will not be caught, and the test case will be
22- deemed to have suffered an error, exactly as for an
23- unexpected exception.
19+ by callableObj when invoked with arguments args and keyword
20+ arguments kwargs. If a different type of exception is
21+ raised, it will not be caught, and the test case will be
22+ deemed to have suffered an error, exactly as for an
23+ unexpected exception.
2424
25- If called with callableObj omitted or None, will return a
26- context object used like this::
25+ If called with callableObj omitted or None, will return a
26+ context object used like this::
2727
28- with self.assertRaises(SomeException):
29- do_something()
28+ with self.assertRaises(SomeException):
29+ do_something()
3030
31- The context manager keeps a reference to the exception as
32- the 'exception' attribute. This allows you to inspect the
33- exception after the assertion::
31+ The context manager keeps a reference to the exception as
32+ the 'exception' attribute. This allows you to inspect the
33+ exception after the assertion::
3434
35- with self.assertRaises(SomeException) as cm:
36- do_something()
37- the_exception = cm.exception
38- self.assertEqual(the_exception.error_code, 3)
35+ with self.assertRaises(SomeException) as cm:
36+ do_something()
37+ the_exception = cm.exception
38+ self.assertEqual(the_exception.error_code, 3)
3939 """
4040 context = _AssertRaisesContext (expected_exception , self )
4141 if callableObj is None :
0 commit comments