File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -160,15 +160,17 @@ def test_no_thread_on_shutdown_no_errors_deprecated(
160160 "threading.Thread.start" ,
161161 side_effect = RuntimeError ("can't create new thread at interpreter shutdown" ),
162162 ):
163- with track_session (session_mode = "request" ):
164- with sentry_sdk .new_scope ():
165- try :
166- raise Exception ("all is wrong" )
167- except Exception :
168- sentry_sdk .capture_exception ()
163+ with sentry_sdk .isolation_scope () as scope :
164+ with track_session (scope , session_mode = "request" ):
165+ with sentry_sdk .new_scope ():
166+ try :
167+ raise Exception ("all is wrong" )
168+ except Exception :
169+ sentry_sdk .capture_exception ()
169170
170- with track_session (session_mode = "request" ):
171- pass
171+ with sentry_sdk .isolation_scope () as scope :
172+ with track_session (scope , session_mode = "request" ):
173+ pass
172174
173175 sentry_sdk .get_isolation_scope ().start_session (session_mode = "request" )
174176 sentry_sdk .get_isolation_scope ().end_session ()
You can’t perform that action at this time.
0 commit comments