diff --git a/requirements.txt b/requirements.txt index 2671a6df1..d864321a6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,20 +2,20 @@ -e .[full] # Testing -coverage==7.4.0 +coverage==7.4.1 importlib-metadata==7.0.1 mypy==1.8.0 -ruff==0.1.13 +ruff==0.1.15 typing_extensions==4.9.0 types-contextvars==2.4.7.3 types-PyYAML==6.0.12.12 types-dataclasses==0.6.6 -pytest==7.4.4 +pytest==8.0.0 trio==0.24.0 # Documentation mkdocs==1.5.3 -mkdocs-material==9.5.5 +mkdocs-material==9.5.6 mkautodoc==0.2.0 # Packaging diff --git a/tests/test_routing.py b/tests/test_routing.py index 128f06674..dd7083e81 100644 --- a/tests/test_routing.py +++ b/tests/test_routing.py @@ -684,27 +684,30 @@ def run_shutdown(): # pragma: no cover nonlocal shutdown_called shutdown_called = True - with pytest.warns( - UserWarning, - match=( - "The `lifespan` parameter cannot be used with `on_startup` or `on_shutdown`." # noqa: E501 - ), + with pytest.deprecated_call( + match="The on_startup and on_shutdown parameters are deprecated" ): - app = Router( - on_startup=[run_startup], on_shutdown=[run_shutdown], lifespan=lifespan - ) + with pytest.warns( + UserWarning, + match=( + "The `lifespan` parameter cannot be used with `on_startup` or `on_shutdown`." # noqa: E501 + ), + ): + app = Router( + on_startup=[run_startup], on_shutdown=[run_shutdown], lifespan=lifespan + ) - assert not lifespan_called - assert not startup_called - assert not shutdown_called + assert not lifespan_called + assert not startup_called + assert not shutdown_called - # Triggers the lifespan events - with test_client_factory(app): - ... + # Triggers the lifespan events + with test_client_factory(app): + ... - assert lifespan_called - assert not startup_called - assert not shutdown_called + assert lifespan_called + assert not startup_called + assert not shutdown_called def test_lifespan_sync(test_client_factory):