diff --git a/benchmarks/acms_context_cli_bench.py b/benchmarks/acms_context_cli_bench.py index 5a873666d..c292fcef0 100644 --- a/benchmarks/acms_context_cli_bench.py +++ b/benchmarks/acms_context_cli_bench.py @@ -8,6 +8,7 @@ Measures the performance of: from __future__ import annotations +import contextlib import importlib import sys from pathlib import Path @@ -76,11 +77,9 @@ def _run_show_silent(view: str, fragments: list[Any]) -> None: "cleveragents.cli.renderers._get_console", return_value=mock_console, ), + contextlib.suppress(SystemExit), ): - try: - acms_context_show(view) - except SystemExit: - pass + acms_context_show(view) def _run_clear_silent( @@ -102,11 +101,9 @@ def _run_clear_silent( "cleveragents.cli.renderers._get_console", return_value=mock_console, ), + contextlib.suppress(SystemExit), ): - try: - acms_context_clear(tier=tier, yes=True) - except SystemExit: - pass + acms_context_clear(tier=tier, yes=True) class FormatBudgetUtilizationSuite: