Skip to content

Commit b45cbb5

Browse files
Replace ensure_clean_store with tmp_path in pandas/tests/io/pytables/test_file_handling.py
Replaced all ensure_clean_store mentions and removed the ensure_clean_store import.
1 parent 2d78f41 commit b45cbb5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pandas/tests/io/pytables/test_file_handling.py

Lines changed: 4 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,8 @@ 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+
with HDFStore(tmp_path / setup_path, mode="a") as store:
193192
store["a"] = Series(range(5))
194193
store.flush()
195194
store.flush(fsync=True)
@@ -316,8 +315,8 @@ def test_complibs(tmp_path, lvl, lib, request):
316315
@pytest.mark.skipif(
317316
not is_platform_little_endian(), reason="reason platform is not little endian"
318317
)
319-
def test_encoding(setup_path):
320-
with ensure_clean_store(setup_path) as store:
318+
def test_encoding(tmp_path, setup_path):
319+
with HDFStore(tmp_path / setup_path) as store:
321320
df = DataFrame({"A": "foo", "B": "bar"}, index=range(5))
322321
df.loc[2, "A"] = np.nan
323322
df.loc[3, "B"] = np.nan

0 commit comments

Comments
 (0)