@@ -962,7 +962,9 @@ def test_ignore_spans(
962962 assert span ["name" ] == name
963963
964964
965- def test_ignore_spans_basic (sentry_init , capture_envelopes , capture_record_lost_event_calls ):
965+ def test_ignore_spans_basic (
966+ sentry_init , capture_envelopes , capture_record_lost_event_calls
967+ ):
966968 sentry_init (
967969 traces_sample_rate = 1.0 ,
968970 _experiments = {
@@ -993,7 +995,9 @@ def test_ignore_spans_basic(sentry_init, capture_envelopes, capture_record_lost_
993995 assert lost_event_calls [0 ] == ("ignored" , "span" , None , 1 )
994996
995997
996- def test_ignore_spans_ignored_segment_drops_whole_tree (sentry_init , capture_envelopes , capture_record_lost_event_calls ):
998+ def test_ignore_spans_ignored_segment_drops_whole_tree (
999+ sentry_init , capture_envelopes , capture_record_lost_event_calls
1000+ ):
9971001 # Ignored segments should drop the whole span tree.
9981002 sentry_init (
9991003 traces_sample_rate = 1.0 ,
@@ -1048,16 +1052,12 @@ def test_ignore_spans_ignored_segment_drops_whole_tree_explicit_parent_span(
10481052 assert isinstance (ignored_span , NoOpStreamedSpan )
10491053 assert ignored_span .sampled is False
10501054
1051- span1 = sentry_sdk .traces .start_span (
1052- name = "not ignored 1" , parent_span = ignored_span
1053- )
1055+ span1 = sentry_sdk .traces .start_span (name = "not ignored 1" , parent_span = ignored_span )
10541056 span1 .start ()
10551057 assert isinstance (span1 , NoOpStreamedSpan )
10561058 assert span1 .sampled is False
10571059
1058- span2 = sentry_sdk .traces .start_span (
1059- name = "not ignored 2" , parent_span = ignored_span
1060- )
1060+ span2 = sentry_sdk .traces .start_span (name = "not ignored 2" , parent_span = ignored_span )
10611061 span2 .start ()
10621062 assert isinstance (span2 , NoOpStreamedSpan )
10631063 assert span2 .sampled is False
@@ -1077,7 +1077,9 @@ def test_ignore_spans_ignored_segment_drops_whole_tree_explicit_parent_span(
10771077 assert lost_event_call == ("ignored" , "span" , None , 1 )
10781078
10791079
1080- def test_ignore_spans_set_ignored_child_span_as_parent (sentry_init , capture_envelopes , capture_record_lost_event_calls ):
1080+ def test_ignore_spans_set_ignored_child_span_as_parent (
1081+ sentry_init , capture_envelopes , capture_record_lost_event_calls
1082+ ):
10811083 # Ignored non-segment spans should NOT drop the whole subtree under them.
10821084 sentry_init (
10831085 traces_sample_rate = 1.0 ,
@@ -1174,6 +1176,7 @@ def test_ignore_spans_set_ignored_child_span_as_parent_explicit_parent_span(
11741176 for lost_event_call in lost_event_calls :
11751177 assert lost_event_call == ("ignored" , "span" , None , 1 )
11761178
1179+
11771180def test_ignore_spans_reparenting (sentry_init , capture_envelopes ):
11781181 sentry_init (
11791182 traces_sample_rate = 1.0 ,
0 commit comments