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

Method test_unicode_bytestream

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

Source from the content-addressed store, hash-verified

572 assert_array_equal(a, b)
573
574 def test_unicode_bytestream(self):
575 utf8 = b'\xcf\x96'.decode('UTF-8')
576 a = np.array([utf8], dtype=np.str_)
577 s = BytesIO()
578 np.savetxt(s, a, fmt=['%s'], encoding='UTF-8')
579 s.seek(0)
580 assert_equal(s.read().decode('UTF-8'), utf8 + '\n')
581
582 def test_unicode_stringstream(self):
583 utf8 = b'\xcf\x96'.decode('UTF-8')

Callers

nothing calls this directly

Calls 4

assert_equalFunction · 0.90
decodeMethod · 0.80
seekMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected