Skip to content

Commit

Permalink
📝 Update source example for annotated version
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo committed Mar 23, 2024
1 parent 8d6aaf0 commit beaf3f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

def main(user: Annotated[Optional[List[str]], typer.Option()] = None):
if not user:
print("No provided users")
print(f"No provided users (raw input = {user})")
raise typer.Abort()
for u in user:
print(f"Processing user: {u}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def test_main():
result = runner.invoke(app)
assert result.exit_code != 0
assert "No provided users" in result.output
assert "raw input = None" in result.output
assert "Aborted" in result.output


Expand Down

0 comments on commit beaf3f1

Please sign in to comment.