-
First Check
Commit to Help
Example Codefrom typer import Typer
from typer.testing import CliRunner
app = Typer(help="My cool Typer app!")
@app.callback(invoke_without_command=True, no_args_is_help=True)
def main() -> None:
return None
# Comment below and the bug no longer occurs
#@app.command()
#def hello():
# return None
runner = CliRunner()
result = runner.invoke(app, ["--help"])
# We expect the exit code to be 0, but it will return exit_code 1 and an exception
assert result.exit_code == 0, result.exception DescriptionThere is a small regression introduced in #567. If a I tracked the problem down to this code. The fix is to add a check that I have not reviewed the source completely yet to know what a default command length should be, but I will and I am happy to contribute a fix. Operating SystemmacOS Operating System DetailsNo response Typer Version0.12.2 Python Version3.10.14 Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Thanks for the report and the reproducable code! This is fixed by #796 and I used your code to create a unit test for it 🙏 |
Beta Was this translation helpful? Give feedback.
Thanks for the report and the reproducable code! This is fixed by #796 and I used your code to create a unit test for it 🙏