Skip to content

Commit 766c0b6

Browse files
TST: replace ensure_clean_store with tmp_path in test_file_handling.py
1 parent 2d6c51f commit 766c0b6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pandas/tests/io/pytables/test_file_handling.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
)
2525
from pandas.tests.io.pytables.common import (
2626
_maybe_remove,
27-
ensure_clean_store,
2827
tables,
2928
)
3029

@@ -188,8 +187,9 @@ def test_open_args(tmp_path, setup_path, using_infer_string):
188187
assert not os.path.exists(path)
189188

190189

191-
def test_flush(setup_path):
192-
with ensure_clean_store(setup_path) as store:
190+
def test_flush(tmp_path, setup_path):
191+
path = tmp_path / setup_path
192+
with HDFStore(path, mode="w") as store:
193193
store["a"] = Series(range(5))
194194
store.flush()
195195
store.flush(fsync=True)
@@ -316,8 +316,9 @@ def test_complibs(tmp_path, lvl, lib, request):
316316
@pytest.mark.skipif(
317317
not is_platform_little_endian(), reason="reason platform is not little endian"
318318
)
319-
def test_encoding(setup_path):
320-
with ensure_clean_store(setup_path) as store:
319+
def test_encoding(tmp_path, setup_path):
320+
path = tmp_path / setup_path
321+
with HDFStore(path, mode="w") as store:
321322
df = DataFrame({"A": "foo", "B": "bar"}, index=range(5))
322323
df.loc[2, "A"] = np.nan
323324
df.loc[3, "B"] = np.nan

0 commit comments

Comments
 (0)