-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconftest.py
More file actions
51 lines (38 loc) · 1.54 KB
/
conftest.py
File metadata and controls
51 lines (38 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"""Pytest fixtures for zarr-datafusion tests."""
import pytest
from .fixtures import create_test_icechunk_data, create_test_zarr_data
@pytest.fixture
def zarr_store(tmp_path):
"""Create a temporary zarr store with test data.
Yields the path to the zarr store, which is automatically cleaned up after the test.
"""
store_path = tmp_path / "zarr_store.zarr"
create_test_zarr_data(store_path)
yield store_path
@pytest.fixture
def icechunk_store(tmp_path):
"""Create a temporary icechunk store with test data.
Yields the path to the icechunk store, which is automatically cleaned up
after the test.
"""
store_path = tmp_path / "icechunk"
create_test_icechunk_data(store_path)
yield store_path
@pytest.fixture(scope="session")
def session_zarr_store(tmp_path_factory):
"""Create a session-scoped zarr store with test data.
This fixture is created once per test session and shared across all tests.
Useful for read-only tests that don't modify the data.
"""
store_path = tmp_path_factory.mktemp("data") / "zarr_store.zarr"
create_test_zarr_data(store_path)
yield store_path
@pytest.fixture(scope="session")
def session_icechunk_store(tmp_path_factory):
"""Create a session-scoped icechunk store with test data.
This fixture is created once per test session and shared across all tests.
Useful for read-only tests that don't modify the data.
"""
store_path = tmp_path_factory.mktemp("data") / "icechunk"
create_test_icechunk_data(store_path)
yield store_path