# RuntimeError: Cannot run the event loop while another loop is running

- **ID:** `python/starlette-testclient-blocking-async`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Calling asyncio.run() or loop.run_until_complete inside an async test that already has a running loop, often mixing TestClient and AsyncClient.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (92% success)
   ```
   Use httpx.AsyncClient(transport=ASGITransport(app=app), base_url='http://test') with pytest.mark.asyncio
   ```
2. **** (90% success)
   ```
   await the call directly: response = await client.get('/')
   ```

## Dead Ends

- **** — Patches loop globally and can mask other async bugs. (55% fail)
- **** — TestClient blocks; cannot test concurrent async behavior. (60% fail)
