claire/tests/conftest.py
autocommit 6d212b7dbe refactor(testing-test): ♻️ Update test imports to use claire instead of clare in package references
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-20 19:54:05 -07:00

25 lines
522 B
Python

"""Shared pytest fixtures."""
from __future__ import annotations
import sqlite3
import pytest
from claire.db import migrate, open_db
from claire.hlc import HLCGenerator
@pytest.fixture
def conn() -> sqlite3.Connection:
"""In-memory SQLite DB with migrations applied."""
c = open_db(":memory:")
migrate(c)
yield c
c.close()
@pytest.fixture
def gen() -> HLCGenerator:
"""HLC generator pinned to a deterministic machine_id for tests."""
return HLCGenerator(machine_id="test-machine-0000")