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

Method test_converters_nodecode

numpy/lib/tests/test_io.py:699–709  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

697 assert_array_equal(x, a)
698
699 def test_converters_nodecode(self):
700 # test native string converters enabled by setting an encoding
701 utf8 = b'\xcf\x96'.decode('UTF-8')
702 with temppath() as path:
703 with io.open(path, 'wt', encoding='UTF-8') as f:
704 f.write(utf8)
705 x = self.loadfunc(path, dtype=np.str_,
706 converters={0: lambda x: x + 't'},
707 encoding='UTF-8')
708 a = np.array([utf8 + 't'])
709 assert_array_equal(x, a)
710
711
712class TestLoadTxt(LoadTxtBase):

Callers

nothing calls this directly

Calls 5

temppathFunction · 0.90
assert_array_equalFunction · 0.90
decodeMethod · 0.80
openMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected