MCPcopy Index your code
hub / github.com/python/cpython / test_merge_and_mutate

Method test_merge_and_mutate

Lib/test/test_dict.py:1244–1257  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1242 self.check_reentrant_insertion(mutate)
1243
1244 def test_merge_and_mutate(self):
1245 class X:
1246 def __hash__(self):
1247 return 0
1248
1249 def __eq__(self, o):
1250 other.clear()
1251 return False
1252
1253 l = [(i,0) for i in range(1, 1337)]
1254 other = dict(l)
1255 other[X()] = 0
1256 d = {X(): 0, 1: 1}
1257 self.assertRaises(RuntimeError, d.update, other)
1258
1259 def test_free_after_iterating(self):
1260 support.check_free_after_iterating(self, iter, dict)

Callers

nothing calls this directly

Calls 2

XClass · 0.70
assertRaisesMethod · 0.45

Tested by

no test coverage detected