Fix: resolved sqlite concurrency errors (table users already exists) by moving DDL to explicit async initialize() and implementing lazy singleton dependency.
This commit is contained in:
@@ -14,8 +14,10 @@ from ..conftest import _FUZZ_SETTINGS
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def repo(tmp_path):
|
||||
return get_repository(db_path=str(tmp_path / "histogram_test.db"))
|
||||
async def repo(tmp_path):
|
||||
r = get_repository(db_path=str(tmp_path / "histogram_test.db"))
|
||||
await r.initialize()
|
||||
return r
|
||||
|
||||
|
||||
def _log(decky="d", service="ssh", ip="1.2.3.4", timestamp=None):
|
||||
|
||||
@@ -10,8 +10,10 @@ from .conftest import _FUZZ_SETTINGS
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def repo(tmp_path):
|
||||
return get_repository(db_path=str(tmp_path / "test.db"))
|
||||
async def repo(tmp_path):
|
||||
r = get_repository(db_path=str(tmp_path / "test.db"))
|
||||
await r.initialize()
|
||||
return r
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
|
||||
Reference in New Issue
Block a user