From 2a72bdb4411878829a2f940e1378cb4b84ef27be Mon Sep 17 00:00:00 2001 From: Andrew Pimenov Date: Sun, 9 Aug 2026 16:15:08 +0300 Subject: [PATCH] cover empty exception message branch in run_speed_cascade --- tests/test_speed_math.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_speed_math.py b/tests/test_speed_math.py index 15aba0b..80cd37d 100644 --- a/tests/test_speed_math.py +++ b/tests/test_speed_math.py @@ -171,6 +171,17 @@ async def test_an_empty_cascade_is_a_failed_result(): assert result.tier_attempts == [] +async def test_cascade_records_exception_class_name_when_no_message_provided(): + async def bad() -> SpeedResult: + raise Exception() + + result = await run_speed_cascade([("bad", bad)]) + assert result.method == "none" + assert len(result.tier_attempts) == 1 + assert result.tier_attempts[0].ok is False + assert result.tier_attempts[0].reason == "Exception" + + async def test_cascade_never_swallows_cancellation(): import asyncio