|
9 | 9 | date_range, |
10 | 10 | ) |
11 | 11 | from pandas.tests.io.pytables.common import ( |
12 | | - ensure_clean_store, |
13 | | - tables, |
| 12 | + tables |
14 | 13 | ) |
15 | 14 |
|
16 | 15 | pytestmark = [pytest.mark.single_cpu] |
17 | 16 |
|
18 | 17 |
|
19 | | -def test_keys(setup_path): |
20 | | - with ensure_clean_store(setup_path) as store: |
| 18 | +def test_keys(tmp_path): |
| 19 | + path = tmp_path / "test_keys.h5" |
| 20 | + with HDFStore(path) as store: |
21 | 21 | store["a"] = Series( |
22 | 22 | np.arange(10, dtype=np.float64), index=date_range("2020-01-01", periods=10) |
23 | 23 | ) |
@@ -62,20 +62,21 @@ class Table3(tables.IsDescription): |
62 | 62 | assert len(df.columns) == 1 |
63 | 63 |
|
64 | 64 |
|
65 | | -def test_keys_illegal_include_keyword_value(setup_path): |
66 | | - with ensure_clean_store(setup_path) as store: |
| 65 | +def test_keys_illegal_include_keyword_value(tmp_path): |
| 66 | + path = tmp_path / "test_keys_illegal_include_keyword_value.h5" |
| 67 | + with HDFStore(path) as store: |
67 | 68 | with pytest.raises( |
68 | 69 | ValueError, |
69 | 70 | match="`include` should be either 'pandas' or 'native' but is 'illegal'", |
70 | 71 | ): |
71 | 72 | store.keys(include="illegal") |
72 | 73 |
|
73 | 74 |
|
74 | | -def test_keys_ignore_hdf_softlink(setup_path): |
| 75 | +def test_keys_ignore_hdf_softlink(tmp_path): |
75 | 76 | # GH 20523 |
76 | 77 | # Puts a softlink into HDF file and rereads |
77 | | - |
78 | | - with ensure_clean_store(setup_path) as store: |
| 78 | + path = tmp_path / "test_keys_ignore_hdf_softlink.h5" |
| 79 | + with HDFStore(path) as store: |
79 | 80 | df = DataFrame({"A": range(5), "B": range(5)}) |
80 | 81 | store.put("df", df) |
81 | 82 |
|
|
0 commit comments