diff options
author | Benjamin Peterson <benjamin@python.org> | 2015-07-05 00:58:11 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2015-07-05 00:58:11 (GMT) |
commit | 2a48a6eb335e496220aa75f6daae5b56e231b8e4 (patch) | |
tree | a64d419a7608dac39b456a7e98f99e4ae248b945 /Lib/test/test_dict.py | |
parent | 09e60588389710232030a39b1ae9ba99542ba602 (diff) | |
parent | a82f77fb00ca3bd3eb27a6a5d77a19eadcf0ba31 (diff) | |
download | cpython-2a48a6eb335e496220aa75f6daae5b56e231b8e4.zip cpython-2a48a6eb335e496220aa75f6daae5b56e231b8e4.tar.gz cpython-2a48a6eb335e496220aa75f6daae5b56e231b8e4.tar.bz2 |
merge 3.3 (#24407)
Diffstat (limited to 'Lib/test/test_dict.py')
-rw-r--r-- | Lib/test/test_dict.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py index c96d000..bd79728 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 |