Closed matt3o closed 3 months ago
Correction, I did not follow the instructions correctly. However, maybe this helps someone else too :D
You need a LifespanManager and you also need to pass that new object into httpx, then it does work as expected, see code below.
@pytest.fixture(scope="session")
async def aclient():
async with LifespanManager(app) as manager:
async with TestClient(manager.app) as testclient:
yield testclient
Heyho! I tried to get FastAPI streaming to work and according to multiple bug entries this tool here should be the way. However, when I tried it out, I got the errors below. I use the lifespan to inject services into the Starlette request state. Sadly this does appear not to work or I have missed an important step. I will paste the error log below. Thanks already for any help! Matthias