Skip to content

Commit

Permalink
add test case for codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
jakkdl committed Nov 19, 2024
1 parent 3311c18 commit 033120b
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion testing/code/test_excinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1732,8 +1732,23 @@ def test_multiple() -> None:
TypeError("NOT IN SUMMARY"),
]
)
def test_nested_multiple() -> None:
raise ExceptionGroup(
"b" * 10,
[
ExceptionGroup(
"c" * 10,
[
ValueError("NOT IN SUMMARY"),
TypeError("NOT IN SUMMARY"),
]
)
]
)
"""
)
# run with -vv to not truncate summary info, default width in tests is very low
result = pytester.runpytest("-vv")
assert result.ret == 1
backport_str = "exceptiongroup." if sys.version_info < (3, 11) else ""
Expand All @@ -1756,7 +1771,11 @@ def test_multiple() -> None:
"FAILED test_exceptiongroup_short_summary_info.py::test_multiple - "
f"{backport_str}ExceptionGroup: bbbbbbbbbb (2 sub-exceptions)"
),
"*= 4 failed in *",
(
"FAILED test_exceptiongroup_short_summary_info.py::test_nested_multiple - "
f"{backport_str}ExceptionGroup: bbbbbbbbbb (1 sub-exception)"
),
"*= 5 failed in *",
]
)

Expand Down

0 comments on commit 033120b

Please sign in to comment.