Skip to content

Commit 2e4ce2c

Browse files
committed
fix(test): user client is now module scoped
1 parent 316c1b6 commit 2e4ce2c

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

tests/integration/conftest.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,13 @@ async def database_setup():
3333
await sessionmanager.close()
3434

3535

36-
@pytest_asyncio.fixture(scope="session", loop_scope="session")
36+
@pytest_asyncio.fixture(scope="function", loop_scope="session")
37+
async def db_session(database_setup: DatabaseSessionManager):
38+
async with database_setup.session() as session:
39+
yield session
40+
41+
42+
@pytest_asyncio.fixture(scope="module", loop_scope="session")
3743
async def client() -> AsyncGenerator[Any, None]:
3844
# base_url is just a random placeholder url
3945
# ASGITransport is just telling the async client to pass all requests to app
@@ -42,12 +48,6 @@ async def client() -> AsyncGenerator[Any, None]:
4248
yield client
4349

4450

45-
@pytest_asyncio.fixture(scope="function", loop_scope="session")
46-
async def db_session(database_setup: DatabaseSessionManager):
47-
async with database_setup.session() as session:
48-
yield session
49-
50-
5151
@pytest_asyncio.fixture(scope="module", loop_scope="session")
5252
async def admin_client(database_setup: DatabaseSessionManager, client: AsyncClient):
5353
session_id = "temp_id_" + SYSADMIN_COMPUTING_ID

0 commit comments

Comments
 (0)