Home / Function/ test_broken_scope() — fastapi Function Reference

test_broken_scope() — fastapi Function Reference

Architecture documentation for the test_broken_scope() function in test_dependency_yield_scope_websockets.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  572ba7d9_ddf3_bc96_1863_add3a2d94920["test_broken_scope()"]
  52f88bfc_80aa_a753_1eee_72d574fc4932["test_dependency_yield_scope_websockets.py"]
  572ba7d9_ddf3_bc96_1863_add3a2d94920 -->|defined in| 52f88bfc_80aa_a753_1eee_72d574fc4932
  style 572ba7d9_ddf3_bc96_1863_add3a2d94920 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_dependency_yield_scope_websockets.py lines 169–179

def test_broken_scope() -> None:
    with pytest.raises(
        FastAPIError,
        match='The dependency "get_named_func_session" has a scope of "request", it cannot depend on dependencies with scope "function"',
    ):

        @app.websocket("/broken-scope")
        async def get_broken(
            websocket: WebSocket, sessions: BrokenSessionsDep
        ) -> Any:  # pragma: no cover
            pass

Domain

Subdomains

Frequently Asked Questions

What does test_broken_scope() do?
test_broken_scope() is a function in the fastapi codebase, defined in tests/test_dependency_yield_scope_websockets.py.
Where is test_broken_scope() defined?
test_broken_scope() is defined in tests/test_dependency_yield_scope_websockets.py at line 169.

Analyze Your Own Codebase

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

Try Supermodel Free