Skip to content

Commit

Permalink
🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jul 6, 2023
1 parent ca719d1 commit aaafeaf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion tests/test_annotated.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ def cmd(force: Annotated[bool, typer.Option("--force")] = False):
assert result.exit_code == 0, result.output
assert "Forcing operation" in result.output


def test_runner_can_use_an_async_method():
app = typer.Typer()

@app.command()
async def cmd(val: Annotated[int, typer.Argument()] = 0):
print(f"hello {val}")
Expand All @@ -70,4 +72,4 @@ async def cmd(val: Annotated[int, typer.Argument()] = 0):

result = runner.invoke(app, ["42"])
assert result.exit_code == 0, result.output
assert "hello 42" in result.output
assert "hello 42" in result.output
3 changes: 1 addition & 2 deletions typer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pathlib import Path
from traceback import FrameSummary, StackSummary
from types import TracebackType
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Type, Union, ParamSpec
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Type, Union
from uuid import UUID

import click
Expand Down Expand Up @@ -278,7 +278,6 @@ def runner(*args, **kwargs) -> Any:
)
)


return decorator

def add_typer(
Expand Down

0 comments on commit aaafeaf

Please sign in to comment.