summaryrefslogtreecommitdiff
path: root/Lib/test/test_dict.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2015-07-04 19:59:50 -0500
committerBenjamin Peterson <benjamin@python.org>2015-07-04 19:59:50 -0500
commitd34c246baf7bdfb2d5dacf04b7d5fae76a20ed2c (patch)
treea78d02f247ee3437877e6611700d5ba64189bd19 /Lib/test/test_dict.py
parentd48fb485d9d6597b1048f6131a28cb14979349af (diff)
parente54d5321cc527d0c97a95b90b2754f6494e7b3e1 (diff)
downloadcpython-git-d34c246baf7bdfb2d5dacf04b7d5fae76a20ed2c.tar.gz
merge 3.5 (#24407)
Diffstat (limited to 'Lib/test/test_dict.py')
-rw-r--r--Lib/test/test_dict.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py
index 9553c66d14..2488b63474 100644
--- a/Lib/test/test_dict.py
+++ b/Lib/test/test_dict.py
@@ -937,6 +937,20 @@ class DictTest(unittest.TestCase):
d.popitem()
self.check_reentrant_insertion(mutate)
+ def test_merge_and_mutate(self):
+ class X:
+ def __hash__(self):
+ return 0
+
+ def __eq__(self, o):
+ other.clear()
+ return False
+
+ l = [(i,0) for i in range(1, 1337)]
+ other = dict(l)
+ other[X()] = 0
+ d = {X(): 0, 1: 1}
+ self.assertRaises(RuntimeError, d.update, other)
from test import mapping_tests