File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
tests/integrations/stdlib Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -402,13 +402,13 @@ def _maybe_create_breadcrumbs_from_span(hub, span):
402
402
type = "http" ,
403
403
category = "httplib" ,
404
404
data = span ._data ,
405
- hint = {"httplib_response" : span ._data .get ("httplib_response" )},
405
+ hint = {"httplib_response" : span ._data .pop ("httplib_response" , None )},
406
406
)
407
407
elif span .op == "subprocess" :
408
408
hub .add_breadcrumb (
409
409
type = "subprocess" ,
410
410
category = "subprocess" ,
411
411
message = span .description ,
412
412
data = span ._data ,
413
- hint = {"popen_instance" : span ._data .get ("popen_instance" )},
413
+ hint = {"popen_instance" : span ._data .pop ("popen_instance" , None )},
414
414
)
Original file line number Diff line number Diff line change
1
+ import sys
1
2
import pytest
2
3
3
4
try :
@@ -32,7 +33,6 @@ def test_crumb_capture(sentry_init, capture_events):
32
33
"method" : "GET" ,
33
34
"status_code" : 200 ,
34
35
"reason" : "OK" ,
35
- "httplib_response" : crumb ["data" ]["httplib_response" ],
36
36
}
37
37
38
38
@@ -62,9 +62,10 @@ def before_breadcrumb(crumb, hint):
62
62
"status_code" : 200 ,
63
63
"reason" : "OK" ,
64
64
"extra" : "foo" ,
65
- "httplib_response" : crumb ["data" ]["httplib_response" ],
66
65
}
67
66
67
+ assert sys .getrefcount (response ) == 2
68
+
68
69
69
70
def test_httplib_misuse (sentry_init , capture_events ):
70
71
"""HTTPConnection.getresponse must be called after every call to
@@ -104,5 +105,4 @@ def test_httplib_misuse(sentry_init, capture_events):
104
105
"method" : "GET" ,
105
106
"status_code" : 200 ,
106
107
"reason" : "OK" ,
107
- "httplib_response" : crumb ["data" ]["httplib_response" ],
108
108
}
You can’t perform that action at this time.
0 commit comments