API: tokens_db SQLite CRUD (#78)

This commit is contained in:
Colin Maudry
2026-05-13 13:19:50 +02:00
parent 1d190e4086
commit ca44b99016
3 changed files with 170 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
import pytest
@pytest.fixture
def temp_db(tmp_path, monkeypatch):
"""Une SQLite éphémère pour les tests qui modifient la DB."""
db_path = tmp_path / "users.test.sqlite"
monkeypatch.setenv("USERS_DB_PATH", str(db_path))
from src.api import tokens_db
tokens_db.init_schema(db_path)
return db_path