2023-11-15 15:37:06 +00:00
|
|
|
import pytest
|
2024-03-15 18:58:06 +00:00
|
|
|
|
2023-11-15 15:37:06 +00:00
|
|
|
from canaille.backends.sql.backend import Backend
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def sqlalchemy_configuration(configuration):
|
|
|
|
configuration["BACKENDS"] = {
|
|
|
|
"SQL": {"SQL_DATABASE_URI": "sqlite:///:memory:"},
|
|
|
|
}
|
|
|
|
yield configuration
|
|
|
|
del configuration["BACKENDS"]
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def sql_backend(sqlalchemy_configuration):
|
|
|
|
backend = Backend(sqlalchemy_configuration)
|
|
|
|
with backend.session(init=True):
|
|
|
|
yield backend
|