Skip to content

Commit 0cd0426

Browse files
committed
Get rid of one time used fixtures.
1 parent d843a76 commit 0cd0426

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

tests/test_otel.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,6 @@ def batches(spans, http_ver, otel_mode):
143143
return spans[pos : pos + 3]
144144

145145

146-
@pytest.fixture
147-
def batch(batches, idx):
148-
return batches[idx][0]
149-
150-
151-
@pytest.fixture
152-
def scope_spans(batch):
153-
return batch.scope_spans[0].spans
154-
155-
156146
@pytest.fixture
157147
def span(batches, idx):
158148
return batches[idx // 10][0].scope_spans[0].spans[idx % 10]
@@ -287,13 +277,13 @@ class TestOTelSpans:
287277
@pytest.mark.parametrize(
288278
("idx", "size"), [(0, 10), (1, 10), (2, 10)], ids=["batch"] * 3
289279
)
290-
def test_batch_size(self, http_ver, scope_spans, idx, size, otel_mode):
291-
assert len(scope_spans) == size
280+
def test_batch_size(self, http_ver, batches, idx, size, otel_mode):
281+
assert len(batches[idx][0].scope_spans[0].spans) == size
292282

293283
@pytest.mark.parametrize("idx", [0, 1, 2], ids=["batch"] * 3)
294-
def test_service_name(self, http_ver, batch, idx, otel_mode):
284+
def test_service_name(self, http_ver, batches, idx, otel_mode):
295285
assert (
296-
span_attr(batch.resource, "service.name", "string_value")
286+
span_attr(batches[idx][0].resource, "service.name", "string_value")
297287
== f"test_http{http_ver}"
298288
)
299289

0 commit comments

Comments
 (0)