summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_exceptions.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_exceptions.py')
-rw-r--r--Lib/test/test_exceptions.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index b671cbc..8bb2079 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -341,6 +341,12 @@ class ExceptionTests(unittest.TestCase):
else:
self.fail("No exception raised")
+ def testInvalidAttrs(self):
+ self.assertRaises(TypeError, setattr, Exception(), '__cause__', 1)
+ self.assertRaises(TypeError, delattr, Exception(), '__cause__')
+ self.assertRaises(TypeError, setattr, Exception(), '__context__', 1)
+ self.assertRaises(TypeError, delattr, Exception(), '__context__')
+
def testNoneClearsTracebackAttr(self):
try:
raise IndexError(4)