Skip to content

Commit 20f5904

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

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

pandas/tests/io/pytables/test_file_handling.py

Lines changed: 8 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,13 +187,15 @@ 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)
196196

197197

198+
198199
def test_complibs_default_settings(tmp_path, setup_path, using_infer_string):
199200
# GH15943
200201
df = DataFrame(
@@ -316,8 +317,9 @@ def test_complibs(tmp_path, lvl, lib, request):
316317
@pytest.mark.skipif(
317318
not is_platform_little_endian(), reason="reason platform is not little endian"
318319
)
319-
def test_encoding(setup_path):
320-
with ensure_clean_store(setup_path) as store:
320+
def test_encoding(tmp_path, setup_path):
321+
path = tmp_path / setup_path
322+
with HDFStore(path, mode="w") as store:
321323
df = DataFrame({"A": "foo", "B": "bar"}, index=range(5))
322324
df.loc[2, "A"] = np.nan
323325
df.loc[3, "B"] = np.nan
@@ -330,6 +332,7 @@ def test_encoding(setup_path):
330332
tm.assert_frame_equal(result, expected)
331333

332334

335+
333336
@pytest.mark.parametrize(
334337
"val",
335338
[

0 commit comments

Comments
 (0)