# ============================================================================== # Author: Simon-Pierre Boucher # File: tests/conftest.py # Desc: Fixtures pytest communes — base SQLite éphémère par test. # ============================================================================== from __future__ import annotations import sys from pathlib import Path import pytest sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) from restoka import db # noqa: E402 @pytest.fixture() def con(tmp_path, monkeypatch): """Connexion SQLite isolée (jamais la base réelle data/restoka.db).""" path = tmp_path / "test.db" monkeypatch.setattr(db, "DB_PATH", path) connection = db.connect(path) yield connection connection.close()