33from datetime import datetime , timezone
44
55import pytest
6- import pytest_asyncio
76
87from diracx .core .exceptions import (
98 PilotAlreadyAssociatedWithJobError ,
1716MAIN_VO = "lhcb"
1817
1918
20- @pytest_asyncio .fixture
19+ @pytest .fixture
2120async def pilot_db ():
2221 agents_db = PilotAgentsDB ("sqlite+aiosqlite:///:memory:" )
2322 async with agents_db .engine_context ():
@@ -26,7 +25,6 @@ async def pilot_db():
2625 yield agents_db
2726
2827
29- @pytest .mark .asyncio
3028async def test_register_pilots_roundtrip (pilot_db : PilotAgentsDB ):
3129 """Register a pilot and read it back with its defaults."""
3230 async with pilot_db as db :
@@ -47,7 +45,6 @@ async def test_register_pilots_roundtrip(pilot_db: PilotAgentsDB):
4745 assert not pilot ["AccountingSent" ]
4846
4947
50- @pytest .mark .asyncio
5148async def test_update_pilot_metadata_heterogeneous (pilot_db : PilotAgentsDB ):
5249 """A single call must support rows that set different field subsets.
5350
@@ -78,7 +75,6 @@ async def test_update_pilot_metadata_heterogeneous(pilot_db: PilotAgentsDB):
7875 assert rows ["stamp-2" ]["BenchMark" ] == 42.0
7976
8077
81- @pytest .mark .asyncio
8278async def test_update_pilot_metadata_missing_pilot_raises (pilot_db : PilotAgentsDB ):
8379 async with pilot_db as db :
8480 with pytest .raises (PilotNotFoundError ):
@@ -87,7 +83,6 @@ async def test_update_pilot_metadata_missing_pilot_raises(pilot_db: PilotAgentsD
8783 )
8884
8985
90- @pytest .mark .asyncio
9186async def test_assign_jobs_to_pilot_duplicate_raises (pilot_db : PilotAgentsDB ):
9287 """Second assignment of the same (pilot, job) pair must raise."""
9388 async with pilot_db as db :
@@ -109,7 +104,6 @@ async def test_assign_jobs_to_pilot_duplicate_raises(pilot_db: PilotAgentsDB):
109104 )
110105
111106
112- @pytest .mark .asyncio
113107async def test_delete_cascades_logs_and_mappings (pilot_db : PilotAgentsDB ):
114108 """Deleting a pilot removes its logs and job associations."""
115109 async with pilot_db as db :
0 commit comments