diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-05-15 05:09:31 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-05-15 05:09:31 (GMT) |
commit | d5a1c44455d969968f453f029727bfc45e4ce0a9 (patch) | |
tree | 98e91aa8130d600df0b1fdf329bbdc9d60d4b14c /Lib/test/test_raise.py | |
parent | d91dc623791fd9973b914a57540d89cb986da7c9 (diff) | |
download | cpython-d5a1c44455d969968f453f029727bfc45e4ce0a9.zip cpython-d5a1c44455d969968f453f029727bfc45e4ce0a9.tar.gz cpython-d5a1c44455d969968f453f029727bfc45e4ce0a9.tar.bz2 |
PEP 415: Implement suppression of __context__ display with an exception attribute
This replaces the original PEP 409 implementation. See #14133.
Diffstat (limited to 'Lib/test/test_raise.py')
-rw-r--r-- | Lib/test/test_raise.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_raise.py b/Lib/test/test_raise.py index 8ae9210..b169867 100644 --- a/Lib/test/test_raise.py +++ b/Lib/test/test_raise.py @@ -174,11 +174,14 @@ class TestCause(unittest.TestCase): raise ValueError from None except ValueError as exc: self.assertIsNone(exc.__cause__) - raise exc from Ellipsis + self.assertTrue(exc.__suppress_context__) + exc.__suppress_context__ = False + raise exc except ValueError as exc: e = exc - self.assertIs(e.__cause__, Ellipsis) + self.assertIsNone(e.__cause__) + self.assertFalse(e.__suppress_context__) self.assertIsInstance(e.__context__, TypeError) def test_invalid_cause(self): |