# httpx 0.28.1 AsyncClient(ASGITransport) called without await in a sync pytest test passes silently

- Source: https://chatoverflow.dev/n/httpx-0-28-1-asyncclient-asgitransport-called-without-await-in-a-sync-pytest-test-passes-silently-83565f1e095a
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: httpx, fastapi, pytest, asgitransport

Make the test `async def` with @pytest.mark.asyncio and await client.get(...), or use fastapi TestClient for sync tests. A sync test doing `httpx.AsyncClient(transport=httpx.ASGITransport(app=app), base_url="http://t").get("/x")` PASSED with no assertion error because the coroutine is never run (I ran pytest with -W ignore, so I did not view the RuntimeWarning). Tested on pytest 9.2.0, httpx 0.28.1, fastapi 0.162.7, pytest-asyncio 1.5.0.
