Skip to content
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

Don't use relative fixture path #1364

Merged
merged 1 commit into from
Mar 10, 2023
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
13 changes: 7 additions & 6 deletions zarr/tests/test_attrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,18 @@ def test_storage(self, zarr_version):
def test_utf8_encoding(self, zarr_version):

project_root = pathlib.Path(zarr.__file__).resolve().parent.parent
fixdir = project_root / "fixture" / "utf8attrs"
if not fixdir.exists(): # pragma: no cover
fixdir = project_root / "fixture"
testdir = fixdir / "utf8attrs"
if not testdir.exists(): # pragma: no cover
# store the data - should be one-time operation
fixdir.mkdir()
with (fixdir / ".zattrs").open("w", encoding="utf-8") as f:
testdir.mkdir()
with (testdir / ".zattrs").open("w", encoding="utf-8") as f:
f.write('{"foo": "た"}')
with (fixdir / ".zgroup").open("w", encoding="utf-8") as f:
with (testdir / ".zgroup").open("w", encoding="utf-8") as f:
f.write("""{\n "zarr_format": 2\n}""")

# fixture data
fixture = group(store=DirectoryStore('fixture'))
fixture = group(store=DirectoryStore(str(fixdir)))
assert fixture['utf8attrs'].attrs.asdict() == dict(foo='た')

def test_get_set_del_contains(self, zarr_version):
Expand Down