{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing"}],"enrichment":{"capability":"Programmatically trigger ASGI application startup and shutdown events without running a server, enabling testing and mocking of ASGI apps in isolation.","skillfed_tags":["asgi-testing","async-context-manager"],"use_cases":["Write tests for ASGI applications that need lifespan setup and teardown without spinning up a test server.","Mock ASGI applications in unit tests by triggering their startup and shutdown handlers programmatically.","Access and verify lifespan state in an ASGI app during testing via the manager's state-aware app reference.","Test ASGI middleware and lifespan event handlers in isolation without deploying to a running server.","Verify that an ASGI app's startup and shutdown logic executes correctly before integration testing."],"what_it_does":"asgi-lifespan provides a LifespanManager context manager that sends ASGI lifespan events (startup and shutdown) to an ASGI application without requiring an HTTP server to be running. This is primarily useful for testing and mocking ASGI applications\u2014you can combine it with an ASGI-capable HTTP client to send test requests into an app that has been properly initialized through its lifespan protocol.\n\nThe package automatically detects whether you are running under asyncio or trio and handles the async context accordingly. It supports configurable startup and shutdown timeouts, exposes lifespan state for use in request handling, and raises clear exceptions if the application does not support the lifespan protocol or if timeouts occur. The single runtime dependency is sniffio, keeping installation friction minimal.","worth_installing":"Yes, if you test ASGI applications. It is a small, stable, permissive-licensed tool with low install friction and no known vulnerabilities. The long gap since the last release (2023-03-28) is a minor concern for new Python versions, but the repository remains active and the package is marked production/stable. Verify compatibility with your Python version before relying on it for new projects."},"id":"asgi-lifespan","links":{"html":"https://skillfed.io/packages/asgi-lifespan","md":"https://skillfed.io/packages/asgi-lifespan.md","pypi":"https://pypi.org/project/asgi-lifespan/"},"maintenance":{"status":"aging"},"meta":{"latest_release":"2023-03-28","license_spdx":null,"license_treatment":"permissive","name":"asgi-lifespan","python_support":"supports_current","summary":"Programmatic startup/shutdown of ASGI apps."},"popularity":{"monthly_downloads":10518789,"position":1448,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"2.1.0"}
