Skip to content

Commit 54dd5ef

Browse files
committed
tests: update starlette tests after TestClient allow_redirects removal
1 parent b7294d9 commit 54dd5ef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/contrib/asyncio/starlette_tests.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,8 @@ def test_transaction_name_is_route(app, elasticapm_client):
348348
)
349349
def test_trailing_slash_redirect_detection(app, elasticapm_client, url, expected):
350350
client = TestClient(app)
351-
response = client.get(url, allow_redirects=False)
351+
kwargs = {"allow_redirects": False} if starlette_version_tuple < (0, 43) else {"follow_redirects": False}
352+
response = client.get(url, **kwargs)
352353
assert response.status_code == 307
353354
assert len(elasticapm_client.events[constants.TRANSACTION]) == 1
354355
for transaction in elasticapm_client.events[constants.TRANSACTION]:

0 commit comments

Comments
 (0)