summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_dict.py
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2015-07-05 17:31:09 (GMT)
committerLarry Hastings <larry@hastings.org>2015-07-05 17:31:09 (GMT)
commitab30353adbef3a3fdd54fb30856af8ff94f2c108 (patch)
tree4c330aa36e455a7a6223e1488bc7a7a1b384b538 /Lib/test/test_dict.py
parentb34db6ad9b3332c3101bcf7e020e90583693db20 (diff)
parent95f9dd5e72d6a72db0ad7438b65990cba30cf36b (diff)
downloadcpython-ab30353adbef3a3fdd54fb30856af8ff94f2c108.zip
cpython-ab30353adbef3a3fdd54fb30856af8ff94f2c108.tar.gz
cpython-ab30353adbef3a3fdd54fb30856af8ff94f2c108.tar.bz2
Merge with ongoing work in 3.5 branch.
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 9553c66..2488b63 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