From 24b964df00a9841fea9597acdd1865c41d155d56 Mon Sep 17 00:00:00 2001 From: Simon Gurcke Date: Fri, 8 Mar 2024 10:02:54 +1000 Subject: [PATCH] Remove asgi-lifespan dependency --- poetry.lock | 16 +--------------- pyproject.toml | 1 - tests/test_litestar.py | 5 ++--- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/poetry.lock b/poetry.lock index c38db36..e499a58 100644 --- a/poetry.lock +++ b/poetry.lock @@ -47,20 +47,6 @@ files = [ {file = "appnope-0.1.4.tar.gz", hash = "sha256:1de3860566df9caf38f01f86f65e0e13e379af54f9e4bee1e66b48f2efffd1ee"}, ] -[[package]] -name = "asgi-lifespan" -version = "2.1.0" -description = "Programmatic startup/shutdown of ASGI apps." -optional = false -python-versions = ">=3.7" -files = [ - {file = "asgi-lifespan-2.1.0.tar.gz", hash = "sha256:5e2effaf0bfe39829cf2d64e7ecc47c7d86d676a6599f7afba378c31f5e3a308"}, - {file = "asgi_lifespan-2.1.0-py3-none-any.whl", hash = "sha256:ed840706680e28428c01e14afb3875d7d76d3206f3d5b2f2294e059b5c23804f"}, -] - -[package.dependencies] -sniffio = "*" - [[package]] name = "asgiref" version = "3.7.2" @@ -2457,4 +2443,4 @@ starlette = ["httpx", "starlette"] [metadata] lock-version = "2.0" python-versions = ">=3.8,<4.0" -content-hash = "7395c0d9da82e0734ee9732591be23fff4c09270798b20d11c65e84a14c71931" +content-hash = "16fa2d5d2a8ed1b3ff26a5696823a83933acd7ba893d696f76db18c1dcea344b" diff --git a/pyproject.toml b/pyproject.toml index 765b733..09907b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,6 @@ pre-commit = "^3.5.0" ruff = "^0.1.3" [tool.poetry.group.test.dependencies] -asgi-lifespan = "^2.1.0" pytest = "^7.4.3" pytest-asyncio = "^0.21.1" pytest-cov = "^4.1.0" diff --git a/tests/test_litestar.py b/tests/test_litestar.py index 55a2030..fbfe195 100644 --- a/tests/test_litestar.py +++ b/tests/test_litestar.py @@ -68,11 +68,10 @@ def identify_consumer(request: Request) -> Optional[str]: @pytest.fixture(scope="module") async def client(app: Litestar) -> TestClient: - from asgi_lifespan import LifespanManager from litestar.testing import TestClient - async with LifespanManager(app): # type: ignore[arg-type] - return TestClient(app) + with TestClient(app) as client: + return client def test_middleware_requests_ok(client: TestClient, mocker: MockerFixture):