From a81535a364ca2d5aa277977e53c4e2302cae8ea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Elimelek=20de=20Weber?= <38350057+andrekwr@users.noreply.github.com> Date: Fri, 3 Dec 2021 21:11:36 -0300 Subject: BUG: Fix types of errors raised by genfromtxt (#20389) --- numpy/lib/tests/test_io.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'numpy/lib/tests/test_io.py') diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py index 5201b8e6e..c19660cf0 100644 --- a/numpy/lib/tests/test_io.py +++ b/numpy/lib/tests/test_io.py @@ -1425,6 +1425,10 @@ class TestFromTxt(LoadTxtBase): ('F', 25.0, 60.0)], dtype=descriptor) assert_equal(test, control) + def test_bad_fname(self): + with pytest.raises(TypeError, match='fname must be a string,'): + np.genfromtxt(123) + def test_commented_header(self): # Check that names can be retrieved even if the line is commented out. data = TextIO(""" -- cgit v1.2.1