|
10 | 10 | import pandas.util.testing as tm |
11 | 11 |
|
12 | 12 | from pandas.io import common |
13 | | -from pandas.compat import is_platform_windows, StringIO |
| 13 | +from pandas.compat import is_platform_windows, StringIO, FileNotFoundError |
14 | 14 |
|
15 | 15 | from pandas import read_csv, concat |
16 | 16 |
|
@@ -126,17 +126,17 @@ def test_iterator(self): |
126 | 126 | tm.assert_frame_equal(concat(it), expected.iloc[1:]) |
127 | 127 |
|
128 | 128 | @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'), |
133 | 133 | (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'), |
137 | 137 | (pd.read_json, 'os', ValueError, 'json'), |
138 | 138 | (pd.read_msgpack, 'os', ValueError, 'mp'), |
139 | | - (pd.read_pickle, 'os', pd.compat.FileNotFoundError, 'pickle'), |
| 139 | + (pd.read_pickle, 'os', FileNotFoundError, 'pickle'), |
140 | 140 | ]) |
141 | 141 | def test_read_non_existant(self, reader, module, error_class, fn_ext): |
142 | 142 | pytest.importorskip(module) |
|
0 commit comments