File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments