@@ -335,71 +335,6 @@ def test_event(sentry_init, capture_envelopes, expected_error, expected_transact
335335
336336 envelopes = capture_envelopes ()
337337
338- with sentry_sdk .start_transaction (
339- name = "test_transaction" , op = "test_transaction_op"
340- ) as trx :
341- with sentry_sdk .start_span (op = "test_span" ) as span :
342- with sentry_sdk .configure_scope () as scope : # configure scope
343- _generate_event_data (scope )
344- _faulty_function ()
345-
346- (error_envelope , transaction_envelope ) = envelopes
347-
348- error = error_envelope .get_event ()
349- transaction = transaction_envelope .get_transaction_event ()
350- attachment = error_envelope .items [- 1 ]
351-
352- assert error == expected_error (trx , span )
353- assert transaction == expected_transaction (trx , span )
354- assert attachment .headers == {
355- "filename" : "hello.txt" ,
356- "type" : "attachment" ,
357- "content_type" : "text/plain" ,
358- }
359- assert attachment .payload .bytes == b"Hello World"
360-
361-
362- def test_event2 (sentry_init , capture_envelopes , expected_error , expected_transaction ):
363- _init_sentry_sdk (sentry_init )
364-
365- envelopes = capture_envelopes ()
366-
367- with Hub (Hub .current ):
368- sentry_sdk .set_tag ("A" , 1 ) # will not be added
369-
370- with Hub .current : # with hub
371- with sentry_sdk .push_scope () as scope :
372- scope .set_tag ("B" , 1 ) # will not be added
373-
374- with sentry_sdk .start_transaction (
375- name = "test_transaction" , op = "test_transaction_op"
376- ) as trx :
377- with sentry_sdk .start_span (op = "test_span" ) as span :
378- with sentry_sdk .configure_scope () as scope : # configure scope
379- _generate_event_data (scope )
380- _faulty_function ()
381-
382- (error_envelope , transaction_envelope ) = envelopes
383-
384- error = error_envelope .get_event ()
385- transaction = transaction_envelope .get_transaction_event ()
386- attachment = error_envelope .items [- 1 ]
387-
388- assert error == expected_error (trx , span )
389- assert transaction == expected_transaction (trx , span )
390- assert attachment .headers == {
391- "filename" : "hello.txt" ,
392- "type" : "attachment" ,
393- "content_type" : "text/plain" ,
394- }
395- assert attachment .payload .bytes == b"Hello World"
396-
397-
398- def test_event3 (sentry_init , capture_envelopes , expected_error , expected_transaction ):
399- _init_sentry_sdk (sentry_init )
400-
401- envelopes = capture_envelopes ()
402-
403338 with Hub (Hub .current ):
404339 sentry_sdk .set_tag ("A" , 1 ) # will not be added
405340
@@ -431,43 +366,7 @@ def test_event3(sentry_init, capture_envelopes, expected_error, expected_transac
431366 assert attachment .payload .bytes == b"Hello World"
432367
433368
434- def test_event4 (sentry_init , capture_envelopes , expected_error , expected_transaction ):
435- _init_sentry_sdk (sentry_init )
436-
437- envelopes = capture_envelopes ()
438-
439- with Hub (Hub .current ):
440- sentry_sdk .set_tag ("A" , 1 ) # will not be added
441-
442- with Hub (Hub .current ): # with hub clone
443- with sentry_sdk .push_scope () as scope :
444- scope .set_tag ("B" , 1 ) # will not be added
445-
446- with sentry_sdk .start_transaction (
447- name = "test_transaction" , op = "test_transaction_op"
448- ) as trx :
449- with sentry_sdk .start_span (op = "test_span" ) as span :
450- with sentry_sdk .configure_scope () as scope : # configure scope
451- _generate_event_data (scope )
452- _faulty_function ()
453-
454- (error_envelope , transaction_envelope ) = envelopes
455-
456- error = error_envelope .get_event ()
457- transaction = transaction_envelope .get_transaction_event ()
458- attachment = error_envelope .items [- 1 ]
459-
460- assert error == expected_error (trx , span )
461- assert transaction == expected_transaction (trx , span )
462- assert attachment .headers == {
463- "filename" : "hello.txt" ,
464- "type" : "attachment" ,
465- "content_type" : "text/plain" ,
466- }
467- assert attachment .payload .bytes == b"Hello World"
468-
469-
470- def test_event5 (sentry_init , capture_envelopes , expected_error , expected_transaction ):
369+ def test_event2 (sentry_init , capture_envelopes , expected_error , expected_transaction ):
471370 _init_sentry_sdk (sentry_init )
472371
473372 envelopes = capture_envelopes ()
0 commit comments