Skip to content

Commit cd24dfe

Browse files
cli: keep help paths lightweight
1 parent 6c94f9d commit cd24dfe

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

flow360/cli/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class LazyFlow360Group(click.Group):
8282
def invoke(self, ctx):
8383
try:
8484
return super().invoke(ctx)
85-
except click.ClickException:
85+
except (click.ClickException, click.exceptions.Exit, click.Abort):
8686
raise
8787
except Exception as error: # pylint: disable=broad-except
8888
# Convert uncaught SDK auth failures into normal CLI errors.

tests/test_lazy_imports.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ def test_asset_group_help_does_not_import_simulation_summary(monkeypatch):
100100
"flow360.cli.app",
101101
"flow360.cli.assets",
102102
"flow360.cli.simulation_summary",
103+
"flow360.exceptions",
103104
"flow360.component.simulation.simulation_params",
105+
"flow360_schema.exceptions",
106+
"flow360_schema.unit_system",
104107
)
105108

106109
from flow360.cli import (
@@ -112,7 +115,10 @@ def test_asset_group_help_does_not_import_simulation_summary(monkeypatch):
112115
assert result.exit_code == 0
113116
assert "flow360.cli.assets" in sys.modules
114117
assert "flow360.cli.simulation_summary" not in sys.modules
118+
assert "flow360.exceptions" not in sys.modules
115119
assert "flow360.component.simulation.simulation_params" not in sys.modules
120+
assert "flow360_schema.exceptions" not in sys.modules
121+
assert "flow360_schema.unit_system" not in sys.modules
116122

117123

118124
def test_public_namespace_configure_does_not_eagerly_import_cli_modules(monkeypatch):

0 commit comments

Comments
 (0)