Skip to content

Commit ff6fe92

Browse files
committed
TST: Replace ensure_clean_store with tmp_path in tests/io/pytables/test_keys.py
1 parent f4851e5 commit ff6fe92

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

pandas/tests/io/pytables/test_keys.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
date_range,
1010
)
1111
from pandas.tests.io.pytables.common import (
12-
ensure_clean_store,
13-
tables,
12+
tables
1413
)
1514

1615
pytestmark = [pytest.mark.single_cpu]
1716

1817

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:
2121
store["a"] = Series(
2222
np.arange(10, dtype=np.float64), index=date_range("2020-01-01", periods=10)
2323
)
@@ -62,20 +62,21 @@ class Table3(tables.IsDescription):
6262
assert len(df.columns) == 1
6363

6464

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:
6768
with pytest.raises(
6869
ValueError,
6970
match="`include` should be either 'pandas' or 'native' but is 'illegal'",
7071
):
7172
store.keys(include="illegal")
7273

7374

74-
def test_keys_ignore_hdf_softlink(setup_path):
75+
def test_keys_ignore_hdf_softlink(tmp_path):
7576
# GH 20523
7677
# 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:
7980
df = DataFrame({"A": range(5), "B": range(5)})
8081
store.put("df", df)
8182

0 commit comments

Comments
 (0)