Home / Function/ test_websocket_invalid_data() — fastapi Function Reference

test_websocket_invalid_data() — fastapi Function Reference

Architecture documentation for the test_websocket_invalid_data() function in test_tutorial002.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  f7838465_8f65_6736_7f83_c8ca65b0d8ba["test_websocket_invalid_data()"]
  45a8bc94_3841_f038_9f98_489f355c96bd["test_tutorial002.py"]
  f7838465_8f65_6736_7f83_c8ca65b0d8ba -->|defined in| 45a8bc94_3841_f038_9f98_489f355c96bd
  style f7838465_8f65_6736_7f83_c8ca65b0d8ba fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_tutorial/test_websockets/test_tutorial002.py lines 100–106

def test_websocket_invalid_data(app: FastAPI):
    client = TestClient(app)
    with pytest.raises(WebSocketDisconnect):
        with client.websocket_connect("/items/foo/ws?q=bar&token=some-token"):
            pytest.fail(
                "did not raise WebSocketDisconnect on __enter__"
            )  # pragma: no cover

Domain

Subdomains

Frequently Asked Questions

What does test_websocket_invalid_data() do?
test_websocket_invalid_data() is a function in the fastapi codebase, defined in tests/test_tutorial/test_websockets/test_tutorial002.py.
Where is test_websocket_invalid_data() defined?
test_websocket_invalid_data() is defined in tests/test_tutorial/test_websockets/test_tutorial002.py at line 100.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free