Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions pandas/tests/io/pytables/test_file_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
)
from pandas.tests.io.pytables.common import (
_maybe_remove,
ensure_clean_store,
tables,
)

Expand Down Expand Up @@ -188,13 +187,15 @@ def test_open_args(tmp_path, setup_path, using_infer_string):
assert not os.path.exists(path)


def test_flush(setup_path):
with ensure_clean_store(setup_path) as store:
def test_flush(tmp_path, setup_path):
path = tmp_path / setup_path
with HDFStore(path, mode="w") as store:
store["a"] = Series(range(5))
store.flush()
store.flush(fsync=True)



def test_complibs_default_settings(tmp_path, setup_path, using_infer_string):
# GH15943
df = DataFrame(
Expand Down Expand Up @@ -316,8 +317,9 @@ def test_complibs(tmp_path, lvl, lib, request):
@pytest.mark.skipif(
not is_platform_little_endian(), reason="reason platform is not little endian"
)
def test_encoding(setup_path):
with ensure_clean_store(setup_path) as store:
def test_encoding(tmp_path, setup_path):
path = tmp_path / setup_path
with HDFStore(path, mode="w") as store:
df = DataFrame({"A": "foo", "B": "bar"}, index=range(5))
df.loc[2, "A"] = np.nan
df.loc[3, "B"] = np.nan
Expand All @@ -330,6 +332,7 @@ def test_encoding(setup_path):
tm.assert_frame_equal(result, expected)



@pytest.mark.parametrize(
"val",
[
Expand Down
Loading