Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 2 of 2 for _wrap_gen_lifespan_context (0.33 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

  1. tests/test_router_events.py

        assert state.app_shutdown is True
    
    
    def test_router_sync_generator_lifespan(state: State) -> None:
        """Test that a sync generator lifespan works via _wrap_gen_lifespan_context."""
        from collections.abc import Generator
    
        def lifespan(app: FastAPI) -> Generator[None, None, None]:
            state.app_startup = True
            yield
            state.app_shutdown = True
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 11.7K bytes
    - Click Count (0)
  2. fastapi/routing.py

        ) -> bool | None:
            return self._cm.__exit__(exc_type, exc_value, traceback)
    
    
    # Vendored from starlette.routing to avoid importing private symbols
    def _wrap_gen_lifespan_context(
        lifespan_context: Callable[[Any], Generator[Any, Any, Any]],
    ) -> Callable[[Any], AbstractAsyncContextManager[Any]]:
        """
        Wrap a generator-based lifespan context into an async context manager.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 15 11:44:39 GMT 2026
    - 193K bytes
    - Click Count (0)
Back to Top