You are supposed to patch the return value of get_performance
.
with patch(
target="minum_reproducible_example.get_performance",
return_value=Mock(
spec=Performance,
**{"get_score.side_effect": CustomException("Mocked to always fail")}
)
):