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

Method _copy_test

Lib/test/test_collections.py:44–55  ·  view source on GitHub ↗
(self, obj)

Source from the content-addressed store, hash-verified

42 )
43
44 def _copy_test(self, obj):
45 # Test internal copy
46 obj_copy = obj.copy()
47 self.assertIsNot(obj.data, obj_copy.data)
48 self.assertEqual(obj.data, obj_copy.data)
49
50 # Test copy.copy
51 obj.test = [1234] # Make sure instance vars are also copied.
52 obj_copy = copy.copy(obj)
53 self.assertIsNot(obj.data, obj_copy.data)
54 self.assertEqual(obj.data, obj_copy.data)
55 self.assertIs(obj.test, obj_copy.test)
56
57 def test_str_protocol(self):
58 self._superset_test(UserString, str)

Callers 2

test_list_copyMethod · 0.95
test_dict_copyMethod · 0.95

Calls 4

assertIsNotMethod · 0.80
copyMethod · 0.45
assertEqualMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected