@@ -31,9 +31,9 @@ def test_get_finished_spans(self):
31
31
span_processor = export .SimpleExportSpanProcessor (memory_exporter )
32
32
tracer .add_span_processor (span_processor )
33
33
34
- with tracer .start_span ("foo" ):
35
- with tracer .start_span ("bar" ):
36
- with tracer .start_span ("xxx" ):
34
+ with tracer .start_as_current_span ("foo" ):
35
+ with tracer .start_as_current_span ("bar" ):
36
+ with tracer .start_as_current_span ("xxx" ):
37
37
pass
38
38
39
39
span_list = memory_exporter .get_finished_spans ()
@@ -47,9 +47,9 @@ def test_clear(self):
47
47
span_processor = export .SimpleExportSpanProcessor (memory_exporter )
48
48
tracer .add_span_processor (span_processor )
49
49
50
- with tracer .start_span ("foo" ):
51
- with tracer .start_span ("bar" ):
52
- with tracer .start_span ("xxx" ):
50
+ with tracer .start_as_current_span ("foo" ):
51
+ with tracer .start_as_current_span ("bar" ):
52
+ with tracer .start_as_current_span ("xxx" ):
53
53
pass
54
54
55
55
memory_exporter .clear ()
@@ -63,9 +63,9 @@ def test_shutdown(self):
63
63
span_processor = export .SimpleExportSpanProcessor (memory_exporter )
64
64
tracer .add_span_processor (span_processor )
65
65
66
- with tracer .start_span ("foo" ):
67
- with tracer .start_span ("bar" ):
68
- with tracer .start_span ("xxx" ):
66
+ with tracer .start_as_current_span ("foo" ):
67
+ with tracer .start_as_current_span ("bar" ):
68
+ with tracer .start_as_current_span ("xxx" ):
69
69
pass
70
70
71
71
span_list = memory_exporter .get_finished_spans ()
@@ -74,9 +74,9 @@ def test_shutdown(self):
74
74
memory_exporter .shutdown ()
75
75
76
76
# after shutdown no new spans are accepted
77
- with tracer .start_span ("foo" ):
78
- with tracer .start_span ("bar" ):
79
- with tracer .start_span ("xxx" ):
77
+ with tracer .start_as_current_span ("foo" ):
78
+ with tracer .start_as_current_span ("bar" ):
79
+ with tracer .start_as_current_span ("xxx" ):
80
80
pass
81
81
82
82
span_list = memory_exporter .get_finished_spans ()
0 commit comments