Skip to content

Commit 1c2c5c1

Browse files
committed
Updated some tests
1 parent cc8e329 commit 1c2c5c1

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

sentry_sdk/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,8 @@ def single_exception_from_error_tuple(
697697
is_root_exception = exception_id == 0
698698
if not is_root_exception and parent_id is not None:
699699
exception_value["mechanism"]["parent_id"] = parent_id
700-
exception_value["mechanism"]["type"] = "chained"
700+
if "type" not in exception_value["mechanism"]:
701+
exception_value["mechanism"]["type"] = "chained"
701702

702703
if is_root_exception and "type" not in exception_value["mechanism"]:
703704
exception_value["mechanism"]["type"] = "generic"

tests/new_scopes_compat/test_new_scopes_compat_event.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ def create_expected_error_event(trx, span):
3636
"exception": {
3737
"values": [
3838
{
39-
"mechanism": {"type": "generic", "handled": True},
39+
"mechanism": {
40+
"exception_id": 0,
41+
"type": "generic",
42+
"handled": True,
43+
},
4044
"module": None,
4145
"type": "ValueError",
4246
"value": "This is a test exception",

tests/test_exceptiongroup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ def test_exception_chain_context():
258258
"mechanism": {
259259
"handled": False,
260260
"type": "test_suite",
261+
"exception_id": 1,
261262
},
262263
"module": None,
263264
"type": "TypeError",
@@ -267,6 +268,7 @@ def test_exception_chain_context():
267268
"mechanism": {
268269
"handled": False,
269270
"type": "test_suite",
271+
"exception_id": 0,
270272
},
271273
"module": None,
272274
"type": "ValueError",
@@ -297,6 +299,7 @@ def test_simple_exception():
297299
"mechanism": {
298300
"handled": False,
299301
"type": "test_suite",
302+
"exception_id": 0,
300303
},
301304
"module": None,
302305
"type": "ValueError",

0 commit comments

Comments
 (0)