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

Method test_io_open_unbuffered_fromfile

numpy/core/tests/test_multiarray.py:5376–5381  ·  view source on GitHub ↗
(self, x, tmp_filename)

Source from the content-addressed store, hash-verified

5374 assert_raises(OSError, np.fromfile, f, dtype=x.dtype)
5375
5376 def test_io_open_unbuffered_fromfile(self, x, tmp_filename):
5377 # gh-6632
5378 x.tofile(tmp_filename)
5379 with io.open(tmp_filename, 'rb', buffering=0) as f:
5380 y = np.fromfile(f, dtype=x.dtype)
5381 assert_array_equal(y, x.flat)
5382
5383 def test_largish_file(self, tmp_filename):
5384 # check the fallocate path on files > 16MB

Callers

nothing calls this directly

Calls 3

assert_array_equalFunction · 0.90
tofileMethod · 0.80
openMethod · 0.45

Tested by

no test coverage detected