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

Method test_unicode

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

Source from the content-addressed store, hash-verified

547 assert_array_equal(a, b)
548
549 def test_unicode(self):
550 utf8 = b'\xcf\x96'.decode('UTF-8')
551 a = np.array([utf8], dtype=np.str_)
552 with tempdir() as tmpdir:
553 # set encoding as on windows it may not be unicode even on py3
554 np.savetxt(os.path.join(tmpdir, 'test.csv'), a, fmt=['%s'],
555 encoding='UTF-8')
556
557 def test_unicode_roundtrip(self):
558 utf8 = b'\xcf\x96'.decode('UTF-8')

Callers

nothing calls this directly

Calls 3

tempdirFunction · 0.90
decodeMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected