21 lines
472 B
Python
21 lines
472 B
Python
from pathlib import Path
|
|
|
|
import duckdb
|
|
import pytest
|
|
|
|
from admin_analytics.db.schema import ensure_schema
|
|
|
|
|
|
@pytest.fixture
|
|
def db_conn(tmp_path):
|
|
"""Provide a fresh DuckDB connection with schema initialized."""
|
|
conn = duckdb.connect(str(tmp_path / "test.duckdb"))
|
|
ensure_schema(conn)
|
|
yield conn
|
|
conn.close()
|
|
|
|
|
|
@pytest.fixture
|
|
def fixtures_dir():
|
|
"""Return the path to the test fixtures directory."""
|
|
return Path(__file__).parent / "fixtures"
|