Skip to content

Commit c5e63bc

Browse files
authored
refactor: remove invalid code.function.name usage (#137)
This is meant to be a python valid syntax of the module leading to the function, however `item.nodeid` is just the pytest representation of the test, which is not a proper python syntax for the function. Depends-On: #136
1 parent fd2bc80 commit c5e63bc

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

pytest_mergify/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ def _attributes_from_item(
113113
SpanAttributes.CODE_FUNCTION: item.name,
114114
SpanAttributes.CODE_LINENO: line_number or 0,
115115
SpanAttributes.CODE_NAMESPACE: namespace,
116-
"code.function.name": item.nodeid,
117116
"code.file.path": str(_pytest.pathlib.absolutepath(item.reportinfo()[0])),
118117
"code.line.number": line_number or 0,
119118
}

tests/test_spans.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ def test_test(
5353
"code.namespace": "",
5454
"test.case.result.status": "passed",
5555
"code.file.path": anys.ANY_STR,
56-
"code.function.name": "test_test.py::test_pass",
5756
"code.line.number": 0,
5857
}
5958
assert (
@@ -89,7 +88,6 @@ def test_test_failure(
8988
9089
test_test_failure.py:1: AssertionError""",
9190
"code.file.path": anys.ANY_STR,
92-
"code.function.name": "test_test_failure.py::test_error",
9391
"code.line.number": 0,
9492
}
9593
assert (
@@ -127,7 +125,6 @@ def test_skipped():
127125
"code.filepath": "test_test_skipped.py",
128126
"code.namespace": "",
129127
"code.file.path": anys.ANY_STR,
130-
"code.function.name": "test_test_skipped.py::test_skipped",
131128
"code.line.number": 1,
132129
}
133130
assert (
@@ -173,7 +170,6 @@ def test_skipped():
173170
"code.filepath": "test_mark_skipped.py",
174171
"code.namespace": "",
175172
"code.file.path": anys.ANY_STR,
176-
"code.function.name": "test_mark_skipped.py::test_skipped",
177173
"code.line.number": 1,
178174
}
179175
assert (
@@ -208,7 +204,6 @@ def test_not_skipped():
208204
"code.filepath": "test_mark_not_skipped.py",
209205
"code.namespace": "",
210206
"code.file.path": anys.ANY_STR,
211-
"code.function.name": "test_mark_not_skipped.py::test_not_skipped",
212207
"code.line.number": 1,
213208
}
214209
assert (

0 commit comments

Comments
 (0)