Skip to content

Commit 75ff84e

Browse files
committed
CLN: Import FileNotFoundError rather than using pd.compat.FileNotFoundError
1 parent 143d3b5 commit 75ff84e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

pandas/tests/io/test_common.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import pandas.util.testing as tm
1111

1212
from pandas.io import common
13-
from pandas.compat import is_platform_windows, StringIO
13+
from pandas.compat import is_platform_windows, StringIO, FileNotFoundError
1414

1515
from pandas import read_csv, concat
1616

@@ -126,17 +126,17 @@ def test_iterator(self):
126126
tm.assert_frame_equal(concat(it), expected.iloc[1:])
127127

128128
@pytest.mark.parametrize('reader, module, error_class, fn_ext', [
129-
(pd.read_csv, 'os', pd.compat.FileNotFoundError, 'csv'),
130-
(pd.read_table, 'os', pd.compat.FileNotFoundError, 'csv'),
131-
(pd.read_fwf, 'os', pd.compat.FileNotFoundError, 'txt'),
132-
(pd.read_excel, 'xlrd', pd.compat.FileNotFoundError, 'xlsx'),
129+
(pd.read_csv, 'os', FileNotFoundError, 'csv'),
130+
(pd.read_table, 'os', FileNotFoundError, 'csv'),
131+
(pd.read_fwf, 'os', FileNotFoundError, 'txt'),
132+
(pd.read_excel, 'xlrd', FileNotFoundError, 'xlsx'),
133133
(pd.read_feather, 'feather', Exception, 'feather'),
134-
(pd.read_hdf, 'tables', pd.compat.FileNotFoundError, 'h5'),
135-
(pd.read_stata, 'os', pd.compat.FileNotFoundError, 'dta'),
136-
(pd.read_sas, 'os', pd.compat.FileNotFoundError, 'sas7bdat'),
134+
(pd.read_hdf, 'tables', FileNotFoundError, 'h5'),
135+
(pd.read_stata, 'os', FileNotFoundError, 'dta'),
136+
(pd.read_sas, 'os', FileNotFoundError, 'sas7bdat'),
137137
(pd.read_json, 'os', ValueError, 'json'),
138138
(pd.read_msgpack, 'os', ValueError, 'mp'),
139-
(pd.read_pickle, 'os', pd.compat.FileNotFoundError, 'pickle'),
139+
(pd.read_pickle, 'os', FileNotFoundError, 'pickle'),
140140
])
141141
def test_read_non_existant(self, reader, module, error_class, fn_ext):
142142
pytest.importorskip(module)

0 commit comments

Comments
 (0)