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

Method test_io_open_buffered_fromfile

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

Source from the content-addressed store, hash-verified

5401 assert_equal(os.path.getsize(tmp_filename), d.nbytes * 2)
5402
5403 def test_io_open_buffered_fromfile(self, x, tmp_filename):
5404 # gh-6632
5405 x.tofile(tmp_filename)
5406 with io.open(tmp_filename, 'rb', buffering=-1) as f:
5407 y = np.fromfile(f, dtype=x.dtype)
5408 assert_array_equal(y, x.flat)
5409
5410 def test_file_position_after_fromfile(self, tmp_filename):
5411 # gh-4118

Callers

nothing calls this directly

Calls 3

assert_array_equalFunction · 0.90
tofileMethod · 0.80
openMethod · 0.45

Tested by

no test coverage detected