From 8cbe7daf48fd725668c1cb44f2a00bb81abfdfb0 Mon Sep 17 00:00:00 2001 From: JulioLoayzaM Date: Mon, 1 Jul 2024 14:45:21 +0200 Subject: [PATCH] cli: hide local variables in exceptions by default Tracebacks that include test results or test vectors are often too long, so hide the local variables by default, while keeping the option to display them when increasing the verbosity. --- crypto_condor/cli/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crypto_condor/cli/main.py b/crypto_condor/cli/main.py index 6f6ca26..4470e72 100644 --- a/crypto_condor/cli/main.py +++ b/crypto_condor/cli/main.py @@ -23,6 +23,7 @@ rich_markup_mode="rich", no_args_is_help=True, context_settings={"max_content_width": console.width}, + pretty_exceptions_show_locals=False, ) app.add_typer(test.app, name="test", rich_help_panel="Test implementations") @@ -412,3 +413,5 @@ def main( :func:`~crypto_condor.cli.callbacks.print_version` callback. """ set_logging(verbose) + if verbose >= 2: + app.pretty_exceptions_show_locals = True