diff --git a/tests/integrations/fastapi/test_fastapi.py b/tests/integrations/fastapi/test_fastapi.py index 5d1596f497..0bc0f2a7f5 100644 --- a/tests/integrations/fastapi/test_fastapi.py +++ b/tests/integrations/fastapi/test_fastapi.py @@ -565,7 +565,6 @@ async def _error(): else: assert not events - @pytest.mark.asyncio def test_transaction_http_method_default(sentry_init, capture_events): """ @@ -577,7 +576,7 @@ def test_transaction_http_method_default(sentry_init, capture_events): sentry_init( traces_sample_rate=1.0, integrations=[ - StarletteIntegration(), + StarletteIntegration(), FastApiIntegration(), ], ) @@ -610,7 +609,7 @@ def test_transaction_http_method_custom(sentry_init, capture_events): "OPTIONS", "head", ), # capitalization does not matter - ), + ), FastApiIntegration( http_methods_to_capture=( "OPTIONS", @@ -629,9 +628,10 @@ def test_transaction_http_method_custom(sentry_init, capture_events): client.options("/nomessage") client.head("/nomessage") + import ipdb; ipdb.set_trace() assert len(events) == 2 (event1, event2) = events assert event1["request"]["method"] == "OPTIONS" - assert event2["request"]["method"] == "HEAD" + assert event2["request"]["method"] == "HEAD" \ No newline at end of file diff --git a/tests/integrations/starlette/test_starlette.py b/tests/integrations/starlette/test_starlette.py index 6c99f2b671..6b18388655 100644 --- a/tests/integrations/starlette/test_starlette.py +++ b/tests/integrations/starlette/test_starlette.py @@ -1203,6 +1203,7 @@ async def _error(request): assert not events +@pytest.mark.skipif(STARLETTE_VERSION < (0, 20), reason="Requires Starlette >= 0.20, because earlier versions do not support HTTP 'HEAD' requests") def test_transaction_http_method_default(sentry_init, capture_events): """ By default OPTIONS and HEAD requests do not create a transaction. @@ -1229,6 +1230,7 @@ def test_transaction_http_method_default(sentry_init, capture_events): assert event["request"]["method"] == "GET" +@pytest.mark.skipif(STARLETTE_VERSION < (0, 20), reason="Requires Starlette >= 0.20, because earlier versions do not support HTTP 'HEAD' requests") def test_transaction_http_method_custom(sentry_init, capture_events): sentry_init( traces_sample_rate=1.0,