Skip to content

Commit

Permalink
refactor: use case rather than test for type (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
jd authored Jan 3, 2025
1 parent 24dbedf commit af56874
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pytest_mergify/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def pytest_runtest_protocol(
context = opentelemetry.trace.set_span_in_context(self.session_span)
with self.tracer.start_as_current_span(
item.nodeid,
attributes=self._attributes_from_item(item) | {"test.type": "test"},
attributes=self._attributes_from_item(item) | {"test.type": "case"},
context=context,
):
yield
Expand Down
6 changes: 3 additions & 3 deletions tests/test_spans.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_test(
session_span = spans["pytest session start"]

assert spans["test_test.py::test_pass"].attributes == {
"test.type": "test",
"test.type": "case",
"code.function": "test_pass",
"code.lineno": 0,
"code.filepath": "test_test.py",
Expand All @@ -67,7 +67,7 @@ def test_test_failure(
session_span = spans["pytest session start"]

assert spans["test_test_failure.py::test_error"].attributes == {
"test.type": "test",
"test.type": "case",
"code.function": "test_error",
"code.lineno": 0,
"code.filepath": "test_test_failure.py",
Expand Down Expand Up @@ -192,7 +192,7 @@ def test_pass(myfix): pass
)

assert spans["test_fixture_failure.py::test_pass"].attributes == {
"test.type": "test",
"test.type": "case",
"code.function": "test_pass",
"code.lineno": 3,
"code.filepath": "test_fixture_failure.py",
Expand Down

0 comments on commit af56874

Please sign in to comment.