@@ -119,7 +119,7 @@ def test_cache_spans_disabled_middleware(
119119 client .get (reverse ("not_cached_view" ))
120120
121121 sentry_sdk .flush ()
122- spans = [item .payload for item in items if item . type == "span" ]
122+ spans = [item .payload for item in items ]
123123 assert len (spans ) == 2
124124 else :
125125 events = capture_events ()
@@ -162,7 +162,7 @@ def test_cache_spans_disabled_decorator(
162162 client .get (reverse ("cached_view" ))
163163
164164 sentry_sdk .flush ()
165- spans = [item .payload for item in items if item . type == "span" ]
165+ spans = [item .payload for item in items ]
166166 assert len (spans ) == 2
167167 else :
168168 events = capture_events ()
@@ -205,7 +205,7 @@ def test_cache_spans_disabled_templatetag(
205205 client .get (reverse ("view_with_cached_template_fragment" ))
206206
207207 sentry_sdk .flush ()
208- spans = [item .payload for item in items if item . type == "span" ]
208+ spans = [item .payload for item in items ]
209209 assert len (spans ) == 2
210210 else :
211211 events = capture_events ()
@@ -250,7 +250,7 @@ def test_cache_spans_middleware(
250250 client .get (reverse ("not_cached_view" ))
251251
252252 sentry_sdk .flush ()
253- spans = [item .payload for item in items if item . type == "span" ]
253+ spans = [item .payload for item in items ]
254254 # first_event - cache.get
255255 assert spans [0 ]["attributes" ]["sentry.op" ] == "cache.get"
256256 assert spans [0 ]["name" ].startswith ("views.decorators.cache.cache_header." )
@@ -370,7 +370,7 @@ def test_cache_spans_decorator(
370370 client .get (reverse ("cached_view" ))
371371
372372 sentry_sdk .flush ()
373- spans = [item .payload for item in items if item . type == "span" ]
373+ spans = [item .payload for item in items ]
374374 # first_event - cache.get
375375 assert spans [0 ]["attributes" ]["sentry.op" ] == "cache.get"
376376 assert spans [0 ]["name" ].startswith ("views.decorators.cache.cache_header." )
@@ -470,7 +470,7 @@ def test_cache_spans_templatetag(
470470 client .get (reverse ("view_with_cached_template_fragment" ))
471471
472472 sentry_sdk .flush ()
473- spans = [item .payload for item in items if item . type == "span" ]
473+ spans = [item .payload for item in items ]
474474 assert len (spans ) == 5
475475 # first_event - cache.get
476476 assert spans [0 ]["attributes" ]["sentry.op" ] == "cache.get"
@@ -607,7 +607,7 @@ def test_cache_spans_location_with_port(
607607 client .get (reverse ("cached_view" ))
608608
609609 sentry_sdk .flush ()
610- spans = [item .payload for item in items if item . type == "span" ]
610+ spans = [item .payload for item in items ]
611611
612612 for span in spans :
613613 if span ["is_segment" ] is True :
@@ -660,7 +660,7 @@ def test_cache_spans_location_without_port(
660660 client .get (reverse ("cached_view" ))
661661
662662 sentry_sdk .flush ()
663- spans = [item .payload for item in items if item . type == "span" ]
663+ spans = [item .payload for item in items ]
664664
665665 for span in spans :
666666 if span ["is_segment" ] is True :
@@ -709,7 +709,7 @@ def test_cache_spans_location_with_cluster(
709709 client .get (reverse ("cached_view" ))
710710
711711 sentry_sdk .flush ()
712- spans = [item .payload for item in items if item . type == "span" ]
712+ spans = [item .payload for item in items ]
713713
714714 for span in spans :
715715 # because it is a cluster we do not know what host is actually accessed, so we omit the data
@@ -757,7 +757,7 @@ def test_cache_spans_item_size(
757757 client .get (reverse ("cached_view" ))
758758
759759 sentry_sdk .flush ()
760- spans = [item .payload for item in items if item . type == "span" ]
760+ spans = [item .payload for item in items ]
761761 assert len (spans ) == 7
762762 assert spans [0 ]["attributes" ]["sentry.op" ] == "cache.get"
763763 assert not spans [0 ]["attributes" ]["cache.hit" ]
@@ -851,7 +851,7 @@ def test_cache_spans_get_custom_default(
851851 cache .get (f"S{ id + 2 } " , default = "null" )
852852
853853 sentry_sdk .flush ()
854- spans = [item .payload for item in items if item . type == "span" ]
854+ spans = [item .payload for item in items ]
855855 assert len (spans ) == 9
856856
857857 assert spans [0 ]["attributes" ]["sentry.op" ] == "cache.put"
@@ -956,7 +956,7 @@ def test_cache_spans_get_many(
956956 cache .get_many ([f"S{ id } " , f"S{ id + 1 } " ])
957957
958958 sentry_sdk .flush ()
959- spans = [item .payload for item in items if item . type == "span" ]
959+ spans = [item .payload for item in items ]
960960 assert len (spans ) == 8
961961
962962 assert spans [2 ]["attributes" ]["sentry.op" ] == "cache.get"
@@ -1058,7 +1058,7 @@ def test_cache_spans_set_many(
10581058 cache .get (f"S{ id } " )
10591059
10601060 sentry_sdk .flush ()
1061- spans = [item .payload for item in items if item . type == "span" ]
1061+ spans = [item .payload for item in items ]
10621062 assert len (spans ) == 5
10631063
10641064 assert spans [2 ]["attributes" ]["sentry.op" ] == "cache.put"
@@ -1125,7 +1125,7 @@ def test_span_origin_cache(
11251125 client .get (reverse ("cached_view" ))
11261126
11271127 sentry_sdk .flush ()
1128- spans = [item .payload for item in items if item . type == "span" ]
1128+ spans = [item .payload for item in items ]
11291129
11301130 assert spans [1 ]["attributes" ]["sentry.origin" ] == "auto.http.django"
11311131
0 commit comments