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

Method test_deepcopy_frozendict

Lib/test/test_copy.py:428–450  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

426 self.assertIsNot(x["foo"], y["foo"])
427
428 def test_deepcopy_frozendict(self):
429 x = frozendict({"foo": [1, 2], "bar": 3})
430 y = copy.deepcopy(x)
431 self.assertEqual(y, x)
432 self.assertIsNot(x, y)
433 self.assertIsNot(x["foo"], y["foo"])
434
435 # recursive frozendict
436 x = frozendict(foo=[])
437 x['foo'].append(x)
438 y = copy.deepcopy(x)
439 self.assertEqual(y.keys(), x.keys())
440 self.assertIsNot(x, y)
441 self.assertIsNot(x["foo"], y["foo"])
442 self.assertIs(y['foo'][0], y)
443
444 x = frozendict(foo=[])
445 x['foo'].append(x)
446 x = x['foo']
447 y = copy.deepcopy(x)
448 self.assertIsNot(x, y)
449 self.assertIsNot(x[0], y[0])
450 self.assertIs(y[0]['foo'], y)
451
452 @support.skip_emscripten_stack_overflow()
453 @support.skip_wasi_stack_overflow()

Callers

nothing calls this directly

Calls 6

frozendictClass · 0.85
assertIsNotMethod · 0.80
assertEqualMethod · 0.45
appendMethod · 0.45
keysMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected