@@ -195,16 +195,16 @@ def test_read_non_existent(self, reader, module, error_class, fn_ext):
195
195
196
196
path = os .path .join (HERE , "data" , "does_not_exist." + fn_ext )
197
197
msg1 = rf"File (b')?.+does_not_exist\.{ fn_ext } '? does not exist"
198
- msg2 = rf"\[Errno 2 \] No such file or directory: '.+does_not_exist\.{ fn_ext } '"
198
+ msg2 = rf"\[Errno [0-9]+ \] No such file or directory: '.+does_not_exist\.{ fn_ext } '"
199
199
msg3 = "Expected object or value"
200
200
msg4 = "path_or_buf needs to be a string file path or file-like"
201
201
msg5 = (
202
- rf"\[Errno 2 \] File .+does_not_exist\.{ fn_ext } does not exist: "
202
+ rf"\[Errno [0-9]+ \] File .+does_not_exist\.{ fn_ext } does not exist: "
203
203
rf"'.+does_not_exist\.{ fn_ext } '"
204
204
)
205
- msg6 = rf"\[Errno 2 \] 没有那个文件或目录: '.+does_not_exist\.{ fn_ext } '"
205
+ msg6 = rf"\[Errno [0-9]+ \] 没有那个文件或目录: '.+does_not_exist\.{ fn_ext } '"
206
206
msg7 = (
207
- rf"\[Errno 2 \] File o directory non esistente: '.+does_not_exist\.{ fn_ext } '"
207
+ rf"\[Errno [0-9]+ \] File o directory non esistente: '.+does_not_exist\.{ fn_ext } '"
208
208
)
209
209
msg8 = rf"Failed to open local file.+does_not_exist\.{ fn_ext } "
210
210
@@ -265,16 +265,16 @@ def test_read_expands_user_home_dir(
265
265
monkeypatch .setattr (icom , "_expand_user" , lambda x : os .path .join ("foo" , x ))
266
266
267
267
msg1 = rf"File (b')?.+does_not_exist\.{ fn_ext } '? does not exist"
268
- msg2 = rf"\[Errno 2 \] No such file or directory: '.+does_not_exist\.{ fn_ext } '"
268
+ msg2 = rf"\[Errno [0-9]+ \] No such file or directory: '.+does_not_exist\.{ fn_ext } '"
269
269
msg3 = "Unexpected character found when decoding 'false'"
270
270
msg4 = "path_or_buf needs to be a string file path or file-like"
271
271
msg5 = (
272
- rf"\[Errno 2 \] File .+does_not_exist\.{ fn_ext } does not exist: "
272
+ rf"\[Errno [0-9]+ \] File .+does_not_exist\.{ fn_ext } does not exist: "
273
273
rf"'.+does_not_exist\.{ fn_ext } '"
274
274
)
275
- msg6 = rf"\[Errno 2 \] 没有那个文件或目录: '.+does_not_exist\.{ fn_ext } '"
275
+ msg6 = rf"\[Errno [0-9]+ \] 没有那个文件或目录: '.+does_not_exist\.{ fn_ext } '"
276
276
msg7 = (
277
- rf"\[Errno 2 \] File o directory non esistente: '.+does_not_exist\.{ fn_ext } '"
277
+ rf"\[Errno [0-9]+ \] File o directory non esistente: '.+does_not_exist\.{ fn_ext } '"
278
278
)
279
279
msg8 = rf"Failed to open local file.+does_not_exist\.{ fn_ext } "
280
280
@@ -578,7 +578,7 @@ def test_bad_encdoing_errors():
578
578
579
579
def test_errno_attribute ():
580
580
# GH 13872
581
- with pytest .raises (FileNotFoundError , match = "\\ [Errno 2 \\ ]" ) as err :
581
+ with pytest .raises (FileNotFoundError , match = "\\ [Errno [0-9]+ \\ ]" ) as err :
582
582
pd .read_csv ("doesnt_exist" )
583
583
assert err .errno == errno .ENOENT
584
584
0 commit comments