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

Method _check_from

numpy/core/tests/test_multiarray.py:5520–5530  ·  view source on GitHub ↗
(self, s, value, filename, **kw)

Source from the content-addressed store, hash-verified

5518 os.dup = old_dup
5519
5520 def _check_from(self, s, value, filename, **kw):
5521 if 'sep' not in kw:
5522 y = np.frombuffer(s, **kw)
5523 else:
5524 y = np.fromstring(s, **kw)
5525 assert_array_equal(y, value)
5526
5527 with open(filename, 'wb') as f:
5528 f.write(s)
5529 y = np.fromfile(filename, **kw)
5530 assert_array_equal(y, value)
5531
5532 @pytest.fixture(params=["period", "comma"])
5533 def decimal_sep_localization(self, request):

Callers 12

test_nanMethod · 0.95
test_infMethod · 0.95
test_numbersMethod · 0.95
test_binaryMethod · 0.95
test_stringMethod · 0.95
test_counted_stringMethod · 0.95
test_string_with_wsMethod · 0.95
test_asciiMethod · 0.95
test_malformedMethod · 0.95
test_long_sepMethod · 0.95
test_dtypeMethod · 0.95

Calls 4

assert_array_equalFunction · 0.90
openFunction · 0.85
fromstringMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected