From beaf3f19febd087ffb207e58021d33b57cbc3b89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 23 Mar 2024 12:12:43 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Update=20source=20example=20for?= =?UTF-8?q?=20annotated=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs_src/multiple_values/multiple_options/tutorial001_an.py | 2 +- .../test_multiple_options/test_tutorial001_an.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs_src/multiple_values/multiple_options/tutorial001_an.py b/docs_src/multiple_values/multiple_options/tutorial001_an.py index 68ad2519ea..3dd19d8f59 100644 --- a/docs_src/multiple_values/multiple_options/tutorial001_an.py +++ b/docs_src/multiple_values/multiple_options/tutorial001_an.py @@ -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}") diff --git a/tests/test_tutorial/test_multiple_values/test_multiple_options/test_tutorial001_an.py b/tests/test_tutorial/test_multiple_values/test_multiple_options/test_tutorial001_an.py index 0009fd2f05..20ea235307 100644 --- a/tests/test_tutorial/test_multiple_values/test_multiple_options/test_tutorial001_an.py +++ b/tests/test_tutorial/test_multiple_values/test_multiple_options/test_tutorial001_an.py @@ -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