Skip to content

Commit 2feb299

Browse files
committed
Format
1 parent 308a179 commit 2feb299

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

tests/integrations/wsgi/test_wsgi.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,12 @@ def test_long_running_transaction_finished(sentry_init, capture_events):
503503
# we allow transactions to be 0.5 seconds as a maximum
504504
new_max_duration = 0.5
505505

506-
with mock.patch.object(sentry_sdk.integrations.wsgi, "MAX_TRANSACTION_DURATION_SECONDS", new_max_duration):
506+
with mock.patch.object(
507+
sentry_sdk.integrations.wsgi,
508+
"MAX_TRANSACTION_DURATION_SECONDS",
509+
new_max_duration,
510+
):
511+
507512
def generate_content():
508513
# This response will take 1.5 seconds to generate
509514
for _ in range(15):
@@ -525,5 +530,10 @@ def long_running_app(environ, start_response):
525530

526531
(transaction,) = events
527532

528-
transaction_duration = (datetime_from_isoformat(transaction["timestamp"]) - datetime_from_isoformat(transaction["start_timestamp"])).total_seconds()
529-
assert transaction_duration <= new_max_duration * 1.2 # we allow 2% margin for processing the request
533+
transaction_duration = (
534+
datetime_from_isoformat(transaction["timestamp"])
535+
- datetime_from_isoformat(transaction["start_timestamp"])
536+
).total_seconds()
537+
assert (
538+
transaction_duration <= new_max_duration * 1.2
539+
) # we allow 2% margin for processing the request

0 commit comments

Comments
 (0)