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

Method test_shallow_copy

Lib/test/test_defaultdict.py:98–106  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

96 self.assertEqual(e['a'], 42)
97
98 def test_shallow_copy(self):
99 d1 = defaultdict(foobar, {1: 1})
100 d2 = copy.copy(d1)
101 self.assertEqual(d2.default_factory, foobar)
102 self.assertEqual(d2, d1)
103 d1.default_factory = list
104 d2 = copy.copy(d1)
105 self.assertEqual(d2.default_factory, list)
106 self.assertEqual(d2, d1)
107
108 def test_deep_copy(self):
109 d1 = defaultdict(foobar, {1: [1]})

Callers

nothing calls this directly

Calls 3

defaultdictClass · 0.85
copyMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected