mealie/tests/fixtures/fixture_database.py
Hayden 74e13682cb
Refactor/define repository layer (#883)
* move data access layer

* rename dal -> repo
2021-12-18 20:52:36 -09:00

14 lines
295 B
Python

import pytest
from mealie.db.db_setup import SessionLocal
from mealie.repos.all_repositories import AllRepositories, get_repositories
@pytest.fixture()
def database() -> AllRepositories:
try:
db = SessionLocal()
yield get_repositories(db)
finally:
db.close()