File tree Expand file tree Collapse file tree
tests/integrations/stdlib Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -402,13 +402,13 @@ def _maybe_create_breadcrumbs_from_span(hub, span):
402402 type = "http" ,
403403 category = "httplib" ,
404404 data = span ._data ,
405- hint = {"httplib_response" : span ._data .get ("httplib_response" )},
405+ hint = {"httplib_response" : span ._data .pop ("httplib_response" , None )},
406406 )
407407 elif span .op == "subprocess" :
408408 hub .add_breadcrumb (
409409 type = "subprocess" ,
410410 category = "subprocess" ,
411411 message = span .description ,
412412 data = span ._data ,
413- hint = {"popen_instance" : span ._data .get ("popen_instance" )},
413+ hint = {"popen_instance" : span ._data .pop ("popen_instance" , None )},
414414 )
Original file line number Diff line number Diff line change 1+ import sys
12import pytest
23
34try :
@@ -32,7 +33,6 @@ def test_crumb_capture(sentry_init, capture_events):
3233 "method" : "GET" ,
3334 "status_code" : 200 ,
3435 "reason" : "OK" ,
35- "httplib_response" : crumb ["data" ]["httplib_response" ],
3636 }
3737
3838
@@ -62,9 +62,10 @@ def before_breadcrumb(crumb, hint):
6262 "status_code" : 200 ,
6363 "reason" : "OK" ,
6464 "extra" : "foo" ,
65- "httplib_response" : crumb ["data" ]["httplib_response" ],
6665 }
6766
67+ assert sys .getrefcount (response ) == 2
68+
6869
6970def test_httplib_misuse (sentry_init , capture_events ):
7071 """HTTPConnection.getresponse must be called after every call to
@@ -104,5 +105,4 @@ def test_httplib_misuse(sentry_init, capture_events):
104105 "method" : "GET" ,
105106 "status_code" : 200 ,
106107 "reason" : "OK" ,
107- "httplib_response" : crumb ["data" ]["httplib_response" ],
108108 }
You can’t perform that action at this time.
0 commit comments