@@ -40,12 +40,12 @@ def setspanattr(key, value):
40
40
self .span .set_attribute = setspanattr
41
41
self .start_span_patcher = mock .patch .object (
42
42
self .tracer ,
43
- "start_span " ,
43
+ "start_as_current_span " ,
44
44
autospec = True ,
45
45
spec_set = True ,
46
46
return_value = self .span_context_manager ,
47
47
)
48
- self .start_span = self .start_span_patcher .start ()
48
+ self .start_as_current_span = self .start_span_patcher .start ()
49
49
50
50
mocked_response = requests .models .Response ()
51
51
mocked_response .status_code = 200
@@ -70,7 +70,7 @@ def test_basic(self):
70
70
url = "https://www.example.org/foo/bar?x=y#top"
71
71
requests .get (url = url )
72
72
self .assertEqual (1 , len (self .send .call_args_list ))
73
- self .tracer .start_span .assert_called_with (
73
+ self .tracer .start_as_current_span .assert_called_with (
74
74
"/foo/bar" , kind = trace .SpanKind .CLIENT
75
75
)
76
76
self .span_context_manager .__enter__ .assert_called_with ()
@@ -97,10 +97,10 @@ def test_invalid_url(self):
97
97
with self .assertRaises (exception_type ):
98
98
requests .post (url = url )
99
99
self .assertTrue (
100
- self .tracer .start_span .call_args [0 ][0 ].startswith (
100
+ self .tracer .start_as_current_span .call_args [0 ][0 ].startswith (
101
101
"<Unparsable URL"
102
102
),
103
- msg = self .tracer .start_span .call_args ,
103
+ msg = self .tracer .start_as_current_span .call_args ,
104
104
)
105
105
self .span_context_manager .__enter__ .assert_called_with ()
106
106
exitspan = self .span_context_manager .__exit__
0 commit comments