Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ def test_no_arg():
assert "delete" in result.output


def test_no_additional_output():
"""Ensure that no additional output was generated (cf. PR #1262)"""
result = runner.invoke(app)
assert result.output.count("Usage") == 1
assert "Error" not in result.output


def test_create():
result = runner.invoke(app, ["create"])
assert result.exit_code == 0
Expand Down
4 changes: 4 additions & 0 deletions typer/rich_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,10 @@ def rich_format_error(self: click.ClickException) -> None:
Called by custom exception handler to print richly formatted click errors.
Mimics original click.ClickException.echo() function but with rich formatting.
"""
# Don't do anything when it's a NoArgsIsHelpError (without importing it, cf. #1278)
if self.__class__.__name__ == "NoArgsIsHelpError":
return

console = _get_rich_console(stderr=True)
ctx: Union[click.Context, None] = getattr(self, "ctx", None)
if ctx is not None:
Expand Down
Loading