File tree Expand file tree Collapse file tree 3 files changed +4
-25
lines changed
Expand file tree Collapse file tree 3 files changed +4
-25
lines changed Original file line number Diff line number Diff line change 11import inspect
2- import os
32from contextlib import _AsyncGeneratorContextManager , asynccontextmanager
43from typing import Tuple , Type , Union
54from uuid import uuid4
@@ -80,29 +79,18 @@ async def f(cm):
8079
8180@pytest .fixture
8281def sa_manager () -> SQLAlchemyBindManager :
83- test_sync_db_path = f"./{ uuid4 ()} .db"
84- test_async_db_path = f"./{ uuid4 ()} .db"
8582 config = {
8683 "sync" : SQLAlchemyConfig (
87- engine_url = f "sqlite:/// { test_sync_db_path } " ,
84+ engine_url = "sqlite://" ,
8885 engine_options = dict (connect_args = {"check_same_thread" : False }),
8986 ),
9087 "async" : SQLAlchemyAsyncConfig (
91- engine_url = f "sqlite+aiosqlite:/// { test_sync_db_path } " ,
88+ engine_url = "sqlite+aiosqlite://" ,
9289 engine_options = dict (connect_args = {"check_same_thread" : False }),
9390 ),
9491 }
9592
9693 yield SQLAlchemyBindManager (config )
97- try :
98- os .unlink (test_sync_db_path )
99- except FileNotFoundError :
100- pass
101-
102- try :
103- os .unlink (test_async_db_path )
104- except FileNotFoundError :
105- pass
10694
10795 clear_mappers ()
10896
Original file line number Diff line number Diff line change 1- import os
21from typing import Type
3- from uuid import uuid4
42
53import pytest
64from sqlalchemy import Column , Integer , String
1513
1614@pytest .fixture
1715def sa_manager () -> SQLAlchemyBindManager :
18- test_db_path = f"./{ uuid4 ()} .db"
1916 config = SQLAlchemyConfig (
20- engine_url = f "sqlite:/// { test_db_path } " ,
17+ engine_url = "sqlite://" ,
2118 engine_options = dict (connect_args = {"check_same_thread" : False }),
2219 session_options = dict (expire_on_commit = False ),
2320 )
2421 yield SQLAlchemyBindManager (config )
25- try :
26- os .unlink (test_db_path )
27- except FileNotFoundError :
28- pass
2922 clear_mappers ()
3023
3124
Original file line number Diff line number Diff line change 1- from uuid import uuid4
2-
31import pytest
42from sqlalchemy import MetaData
53from sqlalchemy .ext .asyncio import AsyncSession
2119 {"bind_name" : "Invalid Config" },
2220 {
2321 "valid" : SQLAlchemyConfig (
24- engine_url = f "sqlite:/// { uuid4 } .db " ,
22+ engine_url = "sqlite://" ,
2523 engine_options = dict (connect_args = {"check_same_thread" : False }),
2624 session_options = dict (expire_on_commit = False ),
2725 ),
You can’t perform that action at this time.
0 commit comments