5
5
import sqlite_anyio
6
6
7
7
8
- pytestmark = pytest .mark .anyio
9
-
10
-
11
- async def test_context_manager_commit ():
12
- mem_uri = "file:mem0?mode=memory&cache=shared"
8
+ async def test_context_manager_commit (anyio_backend ):
9
+ mem_uri = f"file:{ anyio_backend } _mem0?mode=memory&cache=shared"
13
10
acon0 = await sqlite_anyio .connect (mem_uri , uri = True )
14
11
acur0 = await acon0 .cursor ()
15
12
async with acon0 :
@@ -22,8 +19,8 @@ async def test_context_manager_commit():
22
19
assert await acur1 .fetchone () == ("Python" ,)
23
20
24
21
25
- async def test_context_manager_rollback ():
26
- mem_uri = "file:mem1 ?mode=memory&cache=shared"
22
+ async def test_context_manager_rollback (anyio_backend ):
23
+ mem_uri = f "file:{anyio_backend}_mem1 ?mode=memory&cache=shared"
27
24
acon0 = await sqlite_anyio .connect (mem_uri , uri = True )
28
25
acur0 = await acon0 .cursor ()
29
26
with pytest .raises (RuntimeError ):
@@ -38,9 +35,9 @@ async def test_context_manager_rollback():
38
35
assert await acur1 .fetchone () is None
39
36
40
37
41
- async def test_exception_logger (caplog ):
38
+ async def test_exception_logger (anyio_backend , caplog ):
42
39
caplog .set_level (logging .INFO )
43
- mem_uri = "file:mem2 ?mode=memory&cache=shared"
40
+ mem_uri = f "file:{ anyio_backend } _mem2 ?mode=memory&cache=shared"
44
41
log = logging .getLogger ("logger" )
45
42
acon0 = await sqlite_anyio .connect (mem_uri , uri = True , exception_handler = sqlite_anyio .exception_logger , log = log )
46
43
acur0 = await acon0 .cursor ()
0 commit comments