MCPcopy Index your code
hub / github.com/numpy/numpy / test_unseekable_fromfile

Method test_unseekable_fromfile

numpy/_core/tests/test_multiarray.py:6201–6213  ·  view source on GitHub ↗
(self, tmp_path, param_filename)

Source from the content-addressed store, hash-verified

6199 assert_array_equal(x, y)
6200
6201 def test_unseekable_fromfile(self, tmp_path, param_filename):
6202 # gh-6246
6203 tmp_filename = normalize_filename(tmp_path, param_filename)
6204 x = self._create_data()
6205 x.tofile(tmp_filename)
6206
6207 def fail(*args, **kwargs):
6208 raise OSError('Can not tell or seek')
6209
6210 with open(tmp_filename, 'rb', buffering=0) as f:
6211 f.seek = fail
6212 f.tell = fail
6213 assert_raises(OSError, np.fromfile, f, dtype=x.dtype)
6214
6215 def test_io_open_unbuffered_fromfile(self, tmp_path, param_filename):
6216 # gh-6632

Callers

nothing calls this directly

Calls 5

_create_dataMethod · 0.95
assert_raisesFunction · 0.90
normalize_filenameFunction · 0.85
openFunction · 0.85
tofileMethod · 0.80

Tested by

no test coverage detected