diff options
Diffstat (limited to 'Lib/test/test_augassign.py')
-rw-r--r-- | Lib/test/test_augassign.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_augassign.py b/Lib/test/test_augassign.py index 5093e9d..5930d9e 100644 --- a/Lib/test/test_augassign.py +++ b/Lib/test/test_augassign.py @@ -83,6 +83,10 @@ class AugAssignTest(unittest.TestCase): def __iadd__(self, val): return aug_test3(self.val + val) + class aug_test4(aug_test3): + """Blocks inheritance, and fallback to __add__""" + __iadd__ = None + x = aug_test(1) y = x x += 10 @@ -106,6 +110,10 @@ class AugAssignTest(unittest.TestCase): self.assertTrue(y is not x) self.assertEqual(x.val, 13) + x = aug_test4(4) + with self.assertRaises(TypeError): + x += 10 + def testCustomMethods2(test_self): output = [] |