Skip to content

Commit f39685a

Browse files
committed
Fix test_context_manager.py
1 parent 44c687d commit f39685a

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

tests/test_context_manager.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@
55
import sqlite_anyio
66

77

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"
1310
acon0 = await sqlite_anyio.connect(mem_uri, uri=True)
1411
acur0 = await acon0.cursor()
1512
async with acon0:
@@ -22,8 +19,8 @@ async def test_context_manager_commit():
2219
assert await acur1.fetchone() == ("Python",)
2320

2421

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"
2724
acon0 = await sqlite_anyio.connect(mem_uri, uri=True)
2825
acur0 = await acon0.cursor()
2926
with pytest.raises(RuntimeError):
@@ -38,9 +35,9 @@ async def test_context_manager_rollback():
3835
assert await acur1.fetchone() is None
3936

4037

41-
async def test_exception_logger(caplog):
38+
async def test_exception_logger(anyio_backend, caplog):
4239
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"
4441
log = logging.getLogger("logger")
4542
acon0 = await sqlite_anyio.connect(mem_uri, uri=True, exception_handler=sqlite_anyio.exception_logger, log=log)
4643
acur0 = await acon0.cursor()

0 commit comments

Comments
 (0)