diff --git a/pandas/tests/io/test_common.py b/pandas/tests/io/test_common.py index 22aa78919ef0f..d7a21b27308e8 100644 --- a/pandas/tests/io/test_common.py +++ b/pandas/tests/io/test_common.py @@ -129,7 +129,7 @@ def test_iterator(self): (pd.read_csv, "os", FileNotFoundError, "csv"), (pd.read_fwf, "os", FileNotFoundError, "txt"), (pd.read_excel, "xlrd", FileNotFoundError, "xlsx"), - (pd.read_feather, "feather", Exception, "feather"), + (pd.read_feather, "pyarrow", IOError, "feather"), (pd.read_hdf, "tables", FileNotFoundError, "h5"), (pd.read_stata, "os", FileNotFoundError, "dta"), (pd.read_sas, "os", FileNotFoundError, "sas7bdat"), @@ -153,8 +153,11 @@ def test_read_non_existant(self, reader, module, error_class, fn_ext): msg7 = ( fr"\[Errno 2\] File o directory non esistente: '.+does_not_exist\.{fn_ext}'" ) + msg8 = fr"Failed to open local file.+does_not_exist\.{fn_ext}.?, error: .*" + with pytest.raises( - error_class, match=fr"({msg1}|{msg2}|{msg3}|{msg4}|{msg5}|{msg6}|{msg7})" + error_class, + match=fr"({msg1}|{msg2}|{msg3}|{msg4}|{msg5}|{msg6}|{msg7}|{msg8})", ): reader(path) @@ -165,7 +168,7 @@ def test_read_non_existant(self, reader, module, error_class, fn_ext): (pd.read_table, "os", FileNotFoundError, "csv"), (pd.read_fwf, "os", FileNotFoundError, "txt"), (pd.read_excel, "xlrd", FileNotFoundError, "xlsx"), - (pd.read_feather, "feather", Exception, "feather"), + (pd.read_feather, "pyarrow", IOError, "feather"), (pd.read_hdf, "tables", FileNotFoundError, "h5"), (pd.read_stata, "os", FileNotFoundError, "dta"), (pd.read_sas, "os", FileNotFoundError, "sas7bdat"), @@ -193,9 +196,11 @@ def test_read_expands_user_home_dir( msg7 = ( fr"\[Errno 2\] File o directory non esistente: '.+does_not_exist\.{fn_ext}'" ) + msg8 = fr"Failed to open local file.+does_not_exist\.{fn_ext}.?, error: .*" with pytest.raises( - error_class, match=fr"({msg1}|{msg2}|{msg3}|{msg4}|{msg5}|{msg6}|{msg7})" + error_class, + match=fr"({msg1}|{msg2}|{msg3}|{msg4}|{msg5}|{msg6}|{msg7}|{msg8})", ): reader(path) @@ -212,7 +217,7 @@ def test_read_expands_user_home_dir( (pd.read_excel, "xlrd", ("io", "data", "excel", "test1.xlsx")), ( pd.read_feather, - "feather", + "pyarrow", ("io", "data", "feather", "feather-0_3_1.feather"), ), ( @@ -249,7 +254,7 @@ def test_read_fspath_all(self, reader, module, path, datapath): [ ("to_csv", {}, "os"), ("to_excel", {"engine": "xlwt"}, "xlwt"), - ("to_feather", {}, "feather"), + ("to_feather", {}, "pyarrow"), ("to_html", {}, "os"), ("to_json", {}, "os"), ("to_latex", {}, "os"),