Skip to content

Commit f243e45

Browse files
Replace ensure_clean_store with tmp_path for pandas/tests/io/pytables/test_keys.py
Replaced all the uses of ensure_clean_store in the test_keys.py file and removed the ensure_clean_store import.
1 parent a7e0900 commit f243e45

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

pandas/tests/io/pytables/test_keys.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88
Series,
99
date_range,
1010
)
11-
from pandas.tests.io.pytables.common import (
12-
ensure_clean_store,
13-
tables,
14-
)
11+
from pandas.tests.io.pytables.common import tables
1512

1613
pytestmark = [pytest.mark.single_cpu]
1714

@@ -62,20 +59,20 @@ class Table3(tables.IsDescription):
6259
assert len(df.columns) == 1
6360

6461

65-
def test_keys_illegal_include_keyword_value(setup_path):
66-
with ensure_clean_store(setup_path) as store:
62+
def test_keys_illegal_include_keyword_value(tmp_path, setup_path):
63+
with HDFStore(tmp_path / setup_path) as store:
6764
with pytest.raises(
6865
ValueError,
6966
match="`include` should be either 'pandas' or 'native' but is 'illegal'",
7067
):
7168
store.keys(include="illegal")
7269

7370

74-
def test_keys_ignore_hdf_softlink(setup_path):
71+
def test_keys_ignore_hdf_softlink(tmp_path, setup_path):
7572
# GH 20523
7673
# Puts a softlink into HDF file and rereads
7774

78-
with ensure_clean_store(setup_path) as store:
75+
with HDFStore(tmp_path / setup_path) as store:
7976
df = DataFrame({"A": range(5), "B": range(5)})
8077
store.put("df", df)
8178

0 commit comments

Comments
 (0)