diff options
Diffstat (limited to 'numpy/lib/tests/test_io.py')
-rw-r--r-- | numpy/lib/tests/test_io.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py index 333891d46..61c9c0636 100644 --- a/numpy/lib/tests/test_io.py +++ b/numpy/lib/tests/test_io.py @@ -686,6 +686,15 @@ class TestLoadTxt(TestCase): dtype=dt) assert_array_equal(x, a) + def test_str_dtype(self): + # see gh-8033 + c = ["str1", "str2"] + + for dt in (str, np.bytes_): + a = np.array(["str1", "str2"], dtype=dt) + x = np.loadtxt(c, dtype=dt) + assert_array_equal(x, a) + def test_empty_file(self): with suppress_warnings() as sup: sup.filter(message="loadtxt: Empty input file:") |