summaryrefslogtreecommitdiff
path: root/Lib/test/test_augassign.py
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2017-01-11 17:41:28 +0000
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2017-01-11 17:41:28 +0000
commit18a41f9ca5f1835f041dcf25d99b3a5195be66fb (patch)
tree1a63ef0fcfaa8e2fd9ba04db0f2cf18d8abd1df5 /Lib/test/test_augassign.py
parente949ac52e0cb36421bf7712eaba1aadedaa301d1 (diff)
parent19beb8e093de4933bd572a06fff7b1271e8d71dd (diff)
downloadcpython-18a41f9ca5f1835f041dcf25d99b3a5195be66fb.tar.gz
Issue #292Merged fixes from 3.5.
Diffstat (limited to 'Lib/test/test_augassign.py')
-rw-r--r--Lib/test/test_augassign.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_augassign.py b/Lib/test/test_augassign.py
index 5093e9d0f3..5930d9e7a2 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 = []