From a77dddd92717bac60517d3ed9510ceb9f3f94c9f Mon Sep 17 00:00:00 2001 From: svlandeg Date: Wed, 11 Sep 2024 14:39:48 +0200 Subject: [PATCH] fix issues --- .../test_parameter_types/test_enum/test_tutorial004.py | 3 +-- .../test_parameter_types/test_enum/test_tutorial005.py | 3 +-- typer/params.py | 4 ++++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial004.py b/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial004.py index f57bfee64a..9154daebed 100644 --- a/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial004.py +++ b/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial004.py @@ -20,8 +20,7 @@ def test_enum_names(): def test_script(): result = subprocess.run( ["coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + capture_output=True, encoding="utf-8", ) assert "Usage" in result.stdout diff --git a/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial005.py b/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial005.py index 79ae14dbe8..6e2ba78c8d 100644 --- a/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial005.py +++ b/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial005.py @@ -20,8 +20,7 @@ def test_int_enum(): def test_script(): result = subprocess.run( ["coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + capture_output=True, encoding="utf-8", ) assert "Usage" in result.stdout diff --git a/typer/params.py b/typer/params.py index 77c86b694e..2f594c948c 100644 --- a/typer/params.py +++ b/typer/params.py @@ -109,6 +109,7 @@ def Option( show_envvar: bool = True, # Choice case_sensitive: bool = True, + names: bool = False, # Numbers min: Optional[Union[int, float]] = None, max: Optional[Union[int, float]] = None, @@ -171,6 +172,7 @@ def Option( show_envvar: bool = True, # Choice case_sensitive: bool = True, + names: bool = False, # Numbers min: Optional[Union[int, float]] = None, max: Optional[Union[int, float]] = None, @@ -282,6 +284,7 @@ def Argument( hidden: bool = False, # Choice case_sensitive: bool = True, + names: bool = False, # Numbers min: Optional[Union[int, float]] = None, max: Optional[Union[int, float]] = None, @@ -337,6 +340,7 @@ def Argument( hidden: bool = False, # Choice case_sensitive: bool = True, + names: bool = False, # Numbers min: Optional[Union[int, float]] = None, max: Optional[Union[int, float]] = None,