Skip to content

TST: fix test_complibs on mac #57652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2024
Merged
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
6 changes: 6 additions & 0 deletions pandas/tests/io/pytables/test_file_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
is_ci_environment,
is_platform_linux,
is_platform_little_endian,
is_platform_mac,
)
from pandas.errors import (
ClosedFileError,
Expand Down Expand Up @@ -287,12 +288,17 @@ def test_complibs(tmp_path, lvl, lib, request):
result = read_hdf(tmpfile, gname)
tm.assert_frame_equal(result, df)

is_mac = is_platform_mac()

# Open file and check metadata for correct amount of compression
with tables.open_file(tmpfile, mode="r") as h5table:
for node in h5table.walk_nodes(where="/" + gname, classname="Leaf"):
assert node.filters.complevel == lvl
if lvl == 0:
assert node.filters.complib is None
elif is_mac and lib == "blosc2":
res = node.filters.complib
assert res in [lib, "blosc2:blosclz"], res
else:
assert node.filters.complib == lib

Expand Down