From cea750f24b532cbf3947c5cc3126d41c834904b9 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Thu, 12 Sep 2024 17:49:36 +0200 Subject: [PATCH] Linting --- tests/integrations/django/test_basic.py | 26 +++++++++++++++++-------- tests/integrations/flask/test_flask.py | 5 ++++- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/tests/integrations/django/test_basic.py b/tests/integrations/django/test_basic.py index 4a73b25a3a..6329867f74 100644 --- a/tests/integrations/django/test_basic.py +++ b/tests/integrations/django/test_basic.py @@ -141,7 +141,7 @@ def test_has_trace_if_performance_enabled(sentry_init, client, capture_events): sentry_init( integrations=[ DjangoIntegration( - http_methods_to_capture=("HEAD", ), + http_methods_to_capture=("HEAD",), ) ], traces_sample_rate=1.0, @@ -190,9 +190,11 @@ def test_has_trace_if_performance_disabled(sentry_init, client, capture_events): def test_trace_from_headers_if_performance_enabled(sentry_init, client, capture_events): sentry_init( - integrations=[DjangoIntegration( - http_methods_to_capture=("HEAD", ), - )], + integrations=[ + DjangoIntegration( + http_methods_to_capture=("HEAD",), + ) + ], traces_sample_rate=1.0, ) @@ -225,9 +227,11 @@ def test_trace_from_headers_if_performance_disabled( sentry_init, client, capture_events ): sentry_init( - integrations=[DjangoIntegration( - http_methods_to_capture=("HEAD", ), - )], + integrations=[ + DjangoIntegration( + http_methods_to_capture=("HEAD",), + ) + ], ) events = capture_events() @@ -1168,6 +1172,9 @@ def test_span_origin(sentry_init, client, capture_events): def test_transaction_http_method_default(sentry_init, client, capture_events): + """ + By default OPTIONS and HEAD requests do not create a transaction. + """ sentry_init( integrations=[DjangoIntegration()], traces_sample_rate=1.0, @@ -1188,7 +1195,10 @@ def test_transaction_http_method_custom(sentry_init, client, capture_events): sentry_init( integrations=[ DjangoIntegration( - http_methods_to_capture=("OPTIONS", "HEAD"), + http_methods_to_capture=( + "OPTIONS", + "head", + ), # capitalization does not matter ) ], traces_sample_rate=1.0, diff --git a/tests/integrations/flask/test_flask.py b/tests/integrations/flask/test_flask.py index 20eb12623c..6febb12b8b 100644 --- a/tests/integrations/flask/test_flask.py +++ b/tests/integrations/flask/test_flask.py @@ -1010,7 +1010,10 @@ def test_transaction_http_method_custom( traces_sample_rate=1.0, integrations=[ flask_sentry.FlaskIntegration( - http_methods_to_capture=("OPTIONS", "HEAD") + http_methods_to_capture=( + "OPTIONS", + "head", + ) # capitalization does not matter ) # case does not matter ], )