MCPcopy Create free account
hub / github.com/numpy/numpy / test__deepcopy__

Method test__deepcopy__

numpy/core/tests/test_multiarray.py:2283–2293  ·  view source on GitHub ↗
(self, dtype)

Source from the content-addressed store, hash-verified

2281
2282 @pytest.mark.parametrize("dtype", ['O', np.int32, 'i,O'])
2283 def test__deepcopy__(self, dtype):
2284 # Force the entry of NULLs into array
2285 a = np.empty(4, dtype=dtype)
2286 ctypes.memset(a.ctypes.data, 0, a.nbytes)
2287
2288 # Ensure no error is raised, see gh-21833
2289 b = a.__deepcopy__({})
2290
2291 a[0] = 42
2292 with pytest.raises(AssertionError):
2293 assert_array_equal(a, b)
2294
2295 def test__deepcopy__catches_failure(self):
2296 class MyObj:

Callers

nothing calls this directly

Calls 2

assert_array_equalFunction · 0.90
__deepcopy__Method · 0.45

Tested by

no test coverage detected