diff --git a/tests/test_tutorial/test_bigger_applications/test_main.py b/tests/test_tutorial/test_bigger_applications/test_main.py index fe40fad7d..3b395be7a 100644 --- a/tests/test_tutorial/test_bigger_applications/test_main.py +++ b/tests/test_tutorial/test_bigger_applications/test_main.py @@ -1,4 +1,5 @@ import importlib +import warnings import pytest from dirty_equals import IsDict @@ -16,9 +17,21 @@ from ...utils import needs_py39 ], ) def get_client(request: pytest.FixtureRequest): - mod = importlib.import_module(f"docs_src.bigger_applications.{request.param}") - - client = TestClient(mod.app) + # Suppress route conflict warnings. + with warnings.catch_warnings(): + warnings.filterwarnings( + "ignore", + message="Route .* may shadow existing route .*", + category=UserWarning, + ) + warnings.filterwarnings( + "ignore", + message="Route .* may be shadowed by existing route .*", + category=UserWarning, + ) + mod = importlib.import_module(f"docs_src.bigger_applications.{request.param}") + + client = TestClient(mod.app) return client