aconnect_ws does not work with AsyncClient bound to an app #67
Answered
by
frankie567
pavelschon
asked this question in
Q&A
-
Describe the bug
To Reproduce@pytest.fixture(name="client")
async def fixture_client(api: FastAPI) -> AsyncIterator[AsyncClient]:
async with AsyncClient(app=api, base_url="http://test") as client:
yield client
async def test_websocket(client: AsyncClient) -> None:
async with aconnect_ws("/ws/", client) as ws:
data = await ws.receive_json() I get:
Obviously, the endpoint Expected behaviorIt should call directly the FastAPI app, no TCP/HTTP connection should be made. Configuration
|
Beta Was this translation helpful? Give feedback.
Answered by
frankie567
Mar 19, 2024
Replies: 1 comment 2 replies
-
That's explained in the docs. You can't use the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey! Sorry, I missed your answer 🙂
You're right, we should have a lower bound version for
anyio
. I'll fix it.