Skip to content

Commit 8402895

Browse files
test(starlette): Remove invalid failed_request_status_code tests
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.
1 parent 7e4992a commit 8402895

File tree

2 files changed

+0
-2
lines changed

2 files changed

+0
-2
lines changed

tests/integrations/fastapi/test_fastapi.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,6 @@ def test_transaction_name_in_middleware(
519519
([range(400, 403), 500, 501], 405, False),
520520
([range(400, 403), 500, 501], 501, True),
521521
([range(400, 403), 500, 501], 503, False),
522-
([None], 500, False),
523522
],
524523
)
525524
def test_configurable_status_codes(

tests/integrations/starlette/test_starlette.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,6 @@ def test_span_origin(sentry_init, capture_events):
11491149
([range(400, 403), 500, 501], 405, False),
11501150
([range(400, 403), 500, 501], 501, True),
11511151
([range(400, 403), 500, 501], 503, False),
1152-
([None], 500, False),
11531152
],
11541153
)
11551154
def test_configurable_status_codes(

0 commit comments

Comments
 (0)