SPB Git

Repository Public

conftest.py 791 B 26 lines python

1# ==============================================================================2# Author: Simon-Pierre Boucher <contact@spboucher.ai>3# File:   tests/conftest.py4# Desc:   Fixtures pytest communes — base SQLite éphémère par test.5# ==============================================================================6from __future__ import annotations78import sys9from pathlib import Path1011import pytest1213sys.path.insert(0, str(Path(__file__).resolve().parent.parent))1415from restoka import db  # noqa: E402161718@pytest.fixture()19def con(tmp_path, monkeypatch):20    """Connexion SQLite isolée (jamais la base réelle data/restoka.db)."""21    path = tmp_path / "test.db"22    monkeypatch.setattr(db, "DB_PATH", path)23    connection = db.connect(path)24    yield connection25    connection.close()26
Files 6a433149cb299d1b83d9dd27ea6d42cbf62492ad
Menu

Theme