@@ -15,9 +15,6 @@ def test_span(
15
15
assert set (spans .keys ()) == {
16
16
"pytest session start" ,
17
17
"test_span.py::test_pass" ,
18
- "test_span.py::test_pass::setup" ,
19
- "test_span.py::test_pass::call" ,
20
- "test_span.py::test_pass::teardown" ,
21
18
}
22
19
23
20
@@ -45,15 +42,6 @@ def test_test(
45
42
result , spans = pytester_with_spans ()
46
43
session_span = spans ["pytest session start" ]
47
44
48
- expected_spans = (
49
- "test_test.py::test_pass" ,
50
- "test_test.py::test_pass::setup" ,
51
- "test_test.py::test_pass::call" ,
52
- "test_test.py::test_pass::teardown" ,
53
- )
54
- for name in expected_spans :
55
- assert name in spans
56
-
57
45
assert spans ["test_test.py::test_pass" ].attributes == {
58
46
"test.type" : "test" ,
59
47
"code.function" : "test_pass" ,
@@ -71,57 +59,13 @@ def test_test(
71
59
spans ["test_test.py::test_pass" ].parent .span_id == session_span .context .span_id
72
60
)
73
61
74
- assert spans ["test_test.py::test_pass::setup" ].attributes == {
75
- "test.type" : "test.setup" ,
76
- "code.function" : "test_pass" ,
77
- "code.lineno" : 0 ,
78
- "code.filepath" : "test_test.py" ,
79
- "test.case.name" : "test_test.py::test_pass" ,
80
- }
81
- assert (
82
- spans ["test_test.py::test_pass::setup" ].status .status_code
83
- == opentelemetry .trace .StatusCode .UNSET
84
- )
85
-
86
- assert spans ["test_test.py::test_pass::call" ].attributes == {
87
- "test.type" : "test.call" ,
88
- "code.function" : "test_pass" ,
89
- "code.lineno" : 0 ,
90
- "code.filepath" : "test_test.py" ,
91
- "test.case.name" : "test_test.py::test_pass" ,
92
- }
93
- assert (
94
- spans ["test_test.py::test_pass::call" ].status .status_code
95
- == opentelemetry .trace .StatusCode .UNSET
96
- )
97
-
98
- assert spans ["test_test.py::test_pass::teardown" ].attributes == {
99
- "test.type" : "test.teardown" ,
100
- "code.function" : "test_pass" ,
101
- "code.lineno" : 0 ,
102
- "code.filepath" : "test_test.py" ,
103
- "test.case.name" : "test_test.py::test_pass" ,
104
- }
105
- assert (
106
- spans ["test_test.py::test_pass::teardown" ].status .status_code
107
- == opentelemetry .trace .StatusCode .UNSET
108
- )
109
-
110
62
111
63
def test_test_failure (
112
64
pytester_with_spans : conftest .PytesterWithSpanT ,
113
65
) -> None :
114
66
result , spans = pytester_with_spans ("def test_error(): assert False, 'foobar'" )
115
67
session_span = spans ["pytest session start" ]
116
68
117
- expected_spans = (
118
- "test_test_failure.py::test_error" ,
119
- "test_test_failure.py::test_error::setup" ,
120
- "test_test_failure.py::test_error::call" ,
121
- )
122
- for name in expected_spans :
123
- assert name in spans
124
-
125
69
assert spans ["test_test_failure.py::test_error" ].attributes == {
126
70
"test.type" : "test" ,
127
71
"code.function" : "test_error" ,
@@ -151,42 +95,6 @@ def test_test_failure(
151
95
== session_span .context .span_id
152
96
)
153
97
154
- assert spans ["test_test_failure.py::test_error::setup" ].attributes == {
155
- "test.type" : "test.setup" ,
156
- "code.function" : "test_error" ,
157
- "code.lineno" : 0 ,
158
- "code.filepath" : "test_test_failure.py" ,
159
- "test.case.name" : "test_test_failure.py::test_error" ,
160
- }
161
- assert (
162
- spans ["test_test_failure.py::test_error::setup" ].status .status_code
163
- == opentelemetry .trace .StatusCode .UNSET
164
- )
165
-
166
- assert spans ["test_test_failure.py::test_error::call" ].attributes == {
167
- "test.type" : "test.call" ,
168
- "code.function" : "test_error" ,
169
- "code.lineno" : 0 ,
170
- "code.filepath" : "test_test_failure.py" ,
171
- "test.case.name" : "test_test_failure.py::test_error" ,
172
- }
173
- assert (
174
- spans ["test_test_failure.py::test_error::call" ].status .status_code
175
- == opentelemetry .trace .StatusCode .UNSET
176
- )
177
-
178
- assert spans ["test_test_failure.py::test_error::teardown" ].attributes == {
179
- "test.type" : "test.teardown" ,
180
- "code.function" : "test_error" ,
181
- "code.lineno" : 0 ,
182
- "code.filepath" : "test_test_failure.py" ,
183
- "test.case.name" : "test_test_failure.py::test_error" ,
184
- }
185
- assert (
186
- spans ["test_test_failure.py::test_error::teardown" ].status .status_code
187
- == opentelemetry .trace .StatusCode .UNSET
188
- )
189
-
190
98
191
99
def test_fixture (
192
100
pytester_with_spans : conftest .PytesterWithSpanT ,
0 commit comments