Skip to content

Commit c98cfbf

Browse files
Secrusabn
andcommitted
Update tests/ui/test_exception_trace.py
Co-authored-by: Arun Babu Neelicattu <arun.neelicattu@gmail.com>
1 parent b641503 commit c98cfbf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/ui/test_exception_trace.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,10 +372,10 @@ def test_render_with_suppressed_context() -> None:
372372
lineno = 6
373373

374374
# Arrange: Trigger and catch the exception
375-
try:
375+
with pytest.raises(RuntimeError) as excinfo:
376376
raiser_with_suppressed_context.raiser_with_suppressed_context()
377-
except Exception as e:
378-
trace = ExceptionTrace(e)
377+
378+
trace = ExceptionTrace(excinfo.value)
379379

380380
trace.render(io)
381381

0 commit comments

Comments
 (0)