@@ -202,10 +202,11 @@ def test_read_non_existent(self, reader, module, error_class, fn_ext):
202
202
rf"\[Errno 2\] File o directory non esistente: '.+does_not_exist\.{ fn_ext } '"
203
203
)
204
204
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 } '"
205
206
206
207
with pytest .raises (
207
208
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 } )" ,
209
210
):
210
211
reader (path )
211
212
@@ -273,10 +274,11 @@ def test_read_expands_user_home_dir(
273
274
rf"\[Errno 2\] File o directory non esistente: '.+does_not_exist\.{ fn_ext } '"
274
275
)
275
276
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 } '"
276
278
277
279
with pytest .raises (
278
280
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 } )" ,
280
282
):
281
283
reader (path )
282
284
@@ -627,8 +629,10 @@ def test_bad_encdoing_errors():
627
629
@pytest .mark .skipif (WASM , reason = "limited file system access on WASM" )
628
630
def test_errno_attribute ():
629
631
# 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 )
632
636
assert err .errno == errno .ENOENT
633
637
634
638
0 commit comments