Skip to content

Commit 46d0080

Browse files
authored
feat(span): exception name instead of class repr for error_type (#168)
Class name instead of representation is more readable
1 parent 6c6366d commit 46d0080

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pytest_mergify/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def pytest_exception_interact(
220220

221221
test_span.set_attributes(
222222
{
223-
SpanAttributes.EXCEPTION_TYPE: str(excinfo.type),
223+
SpanAttributes.EXCEPTION_TYPE: str(excinfo.type.__name__),
224224
SpanAttributes.EXCEPTION_MESSAGE: str(excinfo.value),
225225
SpanAttributes.EXCEPTION_STACKTRACE: str(report.longrepr),
226226
}

tests/test_spans.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def test_test_failure(
101101
"code.lineno": 0,
102102
"code.filepath": "test_test_failure.py",
103103
"code.namespace": "",
104-
SpanAttributes.EXCEPTION_TYPE: "<class 'AssertionError'>",
104+
SpanAttributes.EXCEPTION_TYPE: "AssertionError",
105105
SpanAttributes.EXCEPTION_MESSAGE: "foobar\nassert False",
106106
SpanAttributes.EXCEPTION_STACKTRACE: """> def test_error(): assert False, 'foobar'
107107
E AssertionError: foobar

0 commit comments

Comments
 (0)