File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed
Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -123,8 +123,10 @@ def test_login(client_login):
123123def test_receive_event (client_login ):
124124 event_id = None
125125 client , _ = client_login
126- with sentry_sdk .init (dsn = get_sentry_dsn (client )):
127- event_id = sentry_sdk .capture_exception (Exception ("a failure" ))
126+
127+ sentry_sdk .init (dsn = get_sentry_dsn (client ))
128+
129+ event_id = sentry_sdk .capture_exception (Exception ("a failure" ))
128130 assert event_id is not None
129131 response = poll_for_response (
130132 f"{ SENTRY_TEST_HOST } /api/0/projects/sentry/internal/events/{ event_id } /" , client
@@ -377,18 +379,19 @@ def test_custom_certificate_authorities():
377379
378380def test_receive_transaction_events (client_login ):
379381 client , _ = client_login
380- with sentry_sdk .init (
382+ sentry_sdk .init (
381383 dsn = get_sentry_dsn (client ), profiles_sample_rate = 1.0 , traces_sample_rate = 1.0
382- ):
384+ )
385+
386+ def placeholder_fn ():
387+ sum = 0
388+ for i in range (5 ):
389+ sum += i
390+ time .sleep (0.25 )
383391
384- def placeholder_fn ():
385- sum = 0
386- for i in range (5 ):
387- sum += i
388- time .sleep (0.25 )
392+ with sentry_sdk .start_transaction (op = "task" , name = "Test Transactions" ):
393+ placeholder_fn ()
389394
390- with sentry_sdk .start_transaction (op = "task" , name = "Test Transactions" ):
391- placeholder_fn ()
392395 poll_for_response (
393396 f"{ SENTRY_TEST_HOST } /api/0/organizations/sentry/events/?dataset=profiles&field=profile.id&project=1&statsPeriod=1h" ,
394397 client ,
You can’t perform that action at this time.
0 commit comments