SPB Git forge

spb/resto-ka

Public

Resto·Ka — tous les restaurants du Québec, menus complets et prix réels (famille ·Ka)

52commits 1branches 0releases
11.6 MBsize
maindefault branch
19 days agolast push
Python 69.3% TypeScript 16.7% CSS 7.9% JavaScript 4.7% HTML 1.4%
791 B · 26 lines python
Raw Blame History
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