Skip to content

Commit 4d439e6

Browse files
committed
Run in-memory sqlite db
1 parent 68ae744 commit 4d439e6

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

tests/storage/conftest.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import os
21
from collections.abc import AsyncIterator
3-
from uuid import uuid4
42

53
import pytest
64
from sqlalchemy.orm import clear_mappers
@@ -11,11 +9,10 @@
119

1210
@pytest.fixture(scope="function")
1311
async def test_sa_manager() -> AsyncIterator[SQLAlchemyBindManager]:
14-
test_db_path = f"./{uuid4()}.db"
1512
clear_mappers()
1613

1714
db_config = SQLAlchemyAsyncConfig(
18-
engine_url=f"sqlite+aiosqlite:///{test_db_path}",
15+
engine_url=f"sqlite+aiosqlite://",
1916
engine_options=dict(connect_args={"check_same_thread": False}),
2017
)
2118
sa_manager = SQLAlchemyBindManager(config=db_config)
@@ -25,8 +22,4 @@ async def test_sa_manager() -> AsyncIterator[SQLAlchemyBindManager]:
2522
await conn.run_sync(v.registry_mapper.metadata.create_all)
2623

2724
yield sa_manager
28-
try:
29-
os.unlink(test_db_path)
30-
except FileNotFoundError:
31-
pass
3225
clear_mappers()

0 commit comments

Comments
 (0)