From ccdbffb4909d1c6ded7211b5b8e27663efe7a626 Mon Sep 17 00:00:00 2001 From: Daniel Szoke Date: Tue, 24 Sep 2024 12:41:12 +0200 Subject: [PATCH] test(starlette): Remove invalid `failed_request_status_code` tests (#3560) The Starlette integration tests (as well as the FastAPI integration tests, which hit the same code path as the Starlette integration) include a test where the integrations' `failed_request_status_codes` parameter is set to `[None]`. However, since the parameter is typed as `Optional[list[HttpStatusCodeRange]]`, where `HttpStatusCodeRange = Union[int, Container[int]]`, passing `[None]` for this parameter should not be allowed, per the type hint. Thus, we should not test this input, since the behavior of passing `[None]` is not, and should not be, defined by the API. --- tests/integrations/starlette/test_starlette.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/integrations/starlette/test_starlette.py b/tests/integrations/starlette/test_starlette.py index 9690b874f0..d9dca1669c 100644 --- a/tests/integrations/starlette/test_starlette.py +++ b/tests/integrations/starlette/test_starlette.py @@ -1149,7 +1149,6 @@ def test_span_origin(sentry_init, capture_events): ([range(400, 403), 500, 501], 405, False), ([range(400, 403), 500, 501], 501, True), ([range(400, 403), 500, 501], 503, False), - ([None], 500, False), ], ) """Test cases for configurable status codes.