Skip to content

Commit f2f6a8c

Browse files
committed
fix test
1 parent 56bb9a6 commit f2f6a8c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

pandas/tests/io/test_common.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,11 @@ def test_read_non_existent(self, reader, module, error_class, fn_ext):
202202
rf"\[Errno 2\] File o directory non esistente: '.+does_not_exist\.{fn_ext}'"
203203
)
204204
msg8 = rf"Failed to open local file.+does_not_exist\.{fn_ext}"
205+
msg9 = rf"No such file or directory: '.+does_not_exist\.{fn_ext}'"
205206

206207
with pytest.raises(
207208
error_class,
208-
match=rf"({msg1}|{msg2}|{msg3}|{msg4}|{msg5}|{msg6}|{msg7}|{msg8})",
209+
match=rf"({msg1}|{msg2}|{msg3}|{msg4}|{msg5}|{msg6}|{msg7}|{msg8}|{msg9})",
209210
):
210211
reader(path)
211212

@@ -273,10 +274,11 @@ def test_read_expands_user_home_dir(
273274
rf"\[Errno 2\] File o directory non esistente: '.+does_not_exist\.{fn_ext}'"
274275
)
275276
msg8 = rf"Failed to open local file.+does_not_exist\.{fn_ext}"
277+
msg9 = rf"No such file or directory: '.+does_not_exist\.{fn_ext}'"
276278

277279
with pytest.raises(
278280
error_class,
279-
match=rf"({msg1}|{msg2}|{msg3}|{msg4}|{msg5}|{msg6}|{msg7}|{msg8})",
281+
match=rf"({msg1}|{msg2}|{msg3}|{msg4}|{msg5}|{msg6}|{msg7}|{msg8}|{msg9})",
280282
):
281283
reader(path)
282284

@@ -627,8 +629,10 @@ def test_bad_encdoing_errors():
627629
@pytest.mark.skipif(WASM, reason="limited file system access on WASM")
628630
def test_errno_attribute():
629631
# GH 13872
630-
with pytest.raises(FileNotFoundError, match="\\[Errno 2\\]") as err:
631-
pd.read_csv("doesnt_exist")
632+
non_existent_file = "doesnt_exist"
633+
msg = rf"No such file or directory: '{non_existent_file}'"
634+
with pytest.raises(FileNotFoundError, match=msg) as err:
635+
pd.read_csv(non_existent_file)
632636
assert err.errno == errno.ENOENT
633637

634638

0 commit comments

Comments
 (0)