mirror of
https://github.com/fastapi/fastapi.git
synced 2026-05-18 13:27:45 -04:00
✨ Add support for Trio via AnyIO (#3372)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
@@ -3,6 +3,6 @@ import pytest
|
||||
from docs_src.async_tests.test_main import test_root
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.anyio
|
||||
async def test_async_testing():
|
||||
await test_root()
|
||||
|
||||
@@ -72,9 +72,15 @@ def test_websocket_with_header_and_query():
|
||||
|
||||
def test_websocket_no_credentials():
|
||||
with pytest.raises(WebSocketDisconnect):
|
||||
client.websocket_connect("/items/foo/ws")
|
||||
with client.websocket_connect("/items/foo/ws"):
|
||||
pytest.fail(
|
||||
"did not raise WebSocketDisconnect on __enter__"
|
||||
) # pragma: no cover
|
||||
|
||||
|
||||
def test_websocket_invalid_data():
|
||||
with pytest.raises(WebSocketDisconnect):
|
||||
client.websocket_connect("/items/foo/ws?q=bar&token=some-token")
|
||||
with client.websocket_connect("/items/foo/ws?q=bar&token=some-token"):
|
||||
pytest.fail(
|
||||
"did not raise WebSocketDisconnect on __enter__"
|
||||
) # pragma: no cover
|
||||
|
||||
Reference in New Issue
Block a user