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

Method test_pickle_bytes_overwrite

numpy/core/tests/test_regression.py:1929–1935  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1927 assert_equal(s[0], "\x01")
1928
1929 def test_pickle_bytes_overwrite(self):
1930 for proto in range(2, pickle.HIGHEST_PROTOCOL + 1):
1931 data = np.array([1], dtype='b')
1932 data = pickle.loads(pickle.dumps(data, protocol=proto))
1933 data[0] = 0x7d
1934 bytestring = "\x01 ".encode('ascii')
1935 assert_equal(bytestring[0:1], '\x01'.encode('ascii'))
1936
1937 def test_pickle_py2_array_latin1_hack(self):
1938 # Check that unpickling hacks in Py3 that support

Callers

nothing calls this directly

Calls 2

assert_equalFunction · 0.90
encodeMethod · 0.80

Tested by

no test coverage detected