Skip to content

Commit f75bb99

Browse files
committed
Make PHP fixture session scoped
Quite significant speedups for the `php_api` suite, locally from 140s to 90s.
1 parent e182b57 commit f75bb99

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ async def user_test() -> AsyncIterator[AsyncConnection]:
6565
yield connection
6666

6767

68-
@pytest.fixture
68+
# The PHP API fixture can be session scoped since they do not need access to
69+
# function-scoped database transactions.
70+
@pytest.fixture(scope="session")
6971
async def php_api() -> AsyncIterator[httpx.AsyncClient]:
7072
async with httpx.AsyncClient(base_url=PHP_API_URL) as client:
7173
yield client

0 commit comments

Comments
 (0)