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

Method test_comments_multi_chars

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

Source from the content-addressed store, hash-verified

816 @pytest.mark.skipif(IS_PYPY and sys.implementation.version <= (7, 3, 8),
817 reason="PyPy bug in error formatting")
818 def test_comments_multi_chars(self):
819 c = TextIO()
820 c.write('/* comment\n1,2,3,5\n')
821 c.seek(0)
822 x = np.loadtxt(c, dtype=int, delimiter=',',
823 comments='/*')
824 a = np.array([1, 2, 3, 5], int)
825 assert_array_equal(x, a)
826
827 # Check that '/*' is not transformed to ['/', '*']
828 c = TextIO()
829 c.write('*/ comment\n1,2,3,5\n')
830 c.seek(0)
831 assert_raises(ValueError, np.loadtxt, c, dtype=int, delimiter=',',
832 comments='/*')
833
834 def test_skiprows(self):
835 c = TextIO()

Callers

nothing calls this directly

Calls 5

writeMethod · 0.95
assert_array_equalFunction · 0.90
assert_raisesFunction · 0.90
TextIOClass · 0.85
seekMethod · 0.80

Tested by

no test coverage detected