diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2015-01-23 11:33:53 -0500 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2015-01-23 11:33:53 -0500 |
commit | d44604ef625ff38e835a51cad3bcd24400278eff (patch) | |
tree | c14fa76687ccf967b7a2d6752acbd8020e7b1e49 /numpy/lib/tests | |
parent | 5b714c7ecd46ed8e730afc8f37f8b8d1faf36497 (diff) | |
parent | 8697b9cc58815efb16045542833ee30f2623325b (diff) | |
download | numpy-d44604ef625ff38e835a51cad3bcd24400278eff.tar.gz |
Merge pull request #5489 from charris/cleanup-gh-5156
Cleanup gh 5156
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r-- | numpy/lib/tests/test_io.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py index 68b2018cd..81bddfadd 100644 --- a/numpy/lib/tests/test_io.py +++ b/numpy/lib/tests/test_io.py @@ -786,6 +786,14 @@ class TestLoadTxt(TestCase): # Check for exception and that exception contains line number assert_raises_regex(ValueError, "3", np.loadtxt, c) + def test_none_as_string(self): + # gh-5155, None should work as string when format demands it + c = TextIO() + c.write('100,foo,200\n300,None,400') + c.seek(0) + dt = np.dtype([('x', int), ('a', 'S10'), ('y', int)]) + data = np.loadtxt(c, delimiter=',', dtype=dt, comments=None) + class Testfromregex(TestCase): # np.fromregex expects files opened in binary mode. |