diff --git a/python-typer.changes b/python-typer.changes index fb6a2c1..bfb7057 100644 --- a/python-typer.changes +++ b/python-typer.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Sun May 7 14:47:17 UTC 2023 - Matthias Bach - 0.9.0 + +- Update to upstream version 0.9.0 + * Add support for PEP-593 Annotated for specifying options and + arguments. + * Add support for custom types and parsers. +- Drop patch run-subprocesses-with-correct-python.patch that got + included upstream. + ------------------------------------------------------------------- Thu Jan 5 15:07:01 UTC 2023 - Matthias Bach - 0.7.0 diff --git a/python-typer.spec b/python-typer.spec index d4c769d..e0b6eda 100644 --- a/python-typer.spec +++ b/python-typer.spec @@ -19,14 +19,13 @@ %define skip_python2 1 Name: python-typer -Version: 0.7.0 +Version: 0.9.0 Release: 0 Summary: Typer, build great CLIs. Easy to code. Based on Python type hints License: MIT Group: Development/Languages/Python URL: https://github.com/tiangolo/typer Source: https://files.pythonhosted.org/packages/source/t/typer/typer-%{version}.tar.gz -Patch0: run-subprocesses-with-correct-python.patch Patch1: set-proper-pythonpath-for-tutorial-script-tests.patch BuildRequires: %{python_module click} BuildRequires: %{python_module coverage} @@ -71,6 +70,7 @@ This package provides the Typer Python package required to build and run Typer-b %files %{python_files} %doc README.md %license LICENSE -%{python_sitelib}/* +%{python_sitelib}/typer +%{python_sitelib}/typer-%{version}*-info %changelog diff --git a/run-subprocesses-with-correct-python.patch b/run-subprocesses-with-correct-python.patch deleted file mode 100644 index be9daf7..0000000 --- a/run-subprocesses-with-correct-python.patch +++ /dev/null @@ -1,3122 +0,0 @@ -From: Matthias Bach -Date: Fri, 24 Jun 2022 08:45:31 +0200 -Subject: [PATCH] Consistently use sys.executable to run subprocesses -References: https://github.com/tiangolo/typer/pull/408 -Upstream: sent - -In some scenarios, like running pytest outside of an active virtualenv, -it could happen that "coverage" would refer to a different Python -interpreter than the one running the tests. Admittedly that does not -happen in standard development scenarios where you use a virtualenv. But -it easily happens when packaging for Linux distributions that support -multiple versions of Python and it can also happen when running pytest -from a virtualenv without activating it. The latter is something that's -convenient when testing versus multiple Python versions without using -tox. - -Explicitly invoking coverage as a module on sys.executable ensures that -the same binary, not process, that's also running the tests is used. -This was in fact already done in some tests but not consistently across -all of them. ---- - tests/test_compat/test_option_get_help.py | 3 +- - tests/test_completion/test_completion.py | 16 +++--- - .../test_completion_complete.py | 21 ++++---- - .../test_completion_complete_no_help.py | 9 ++-- - .../test_completion_install.py | 33 ++++++++++-- - tests/test_completion/test_completion_show.py | 53 ++++++++++++++++--- - tests/test_others.py | 9 ++-- - tests/test_prog_name.py | 3 +- - tests/test_tracebacks.py | 7 +-- - .../test_default/test_tutorial001.py | 3 +- - .../test_default/test_tutorial002.py | 3 +- - .../test_envvar/test_tutorial001.py | 3 +- - .../test_envvar/test_tutorial002.py | 3 +- - .../test_envvar/test_tutorial003.py | 3 +- - .../test_help/test_tutorial001.py | 3 +- - .../test_help/test_tutorial002.py | 3 +- - .../test_help/test_tutorial003.py | 3 +- - .../test_help/test_tutorial004.py | 3 +- - .../test_help/test_tutorial005.py | 3 +- - .../test_help/test_tutorial006.py | 3 +- - .../test_help/test_tutorial007.py | 3 +- - .../test_help/test_tutorial008.py | 3 +- - .../test_optional/test_tutorial001.py | 3 +- - .../test_optional/test_tutorial002.py | 3 +- - .../test_arguments/test_tutorial001.py | 3 +- - .../test_callback/test_tutorial001.py | 3 +- - .../test_callback/test_tutorial002.py | 3 +- - .../test_callback/test_tutorial003.py | 3 +- - .../test_callback/test_tutorial004.py | 3 +- - .../test_context/test_tutorial001.py | 3 +- - .../test_context/test_tutorial002.py | 3 +- - .../test_context/test_tutorial003.py | 3 +- - .../test_context/test_tutorial004.py | 3 +- - .../test_help/test_tutorial001.py | 3 +- - .../test_help/test_tutorial002.py | 3 +- - .../test_help/test_tutorial003.py | 3 +- - .../test_help/test_tutorial004.py | 3 +- - .../test_help/test_tutorial005.py | 3 +- - .../test_help/test_tutorial006.py | 3 +- - .../test_help/test_tutorial007.py | 3 +- - .../test_help/test_tutorial008.py | 3 +- - .../test_index/test_tutorial001.py | 3 +- - .../test_index/test_tutorial002.py | 3 +- - .../test_name/test_tutorial001.py | 3 +- - .../test_one_or_multiple/test_tutorial001.py | 3 +- - .../test_one_or_multiple/test_tutorial002.py | 3 +- - .../test_options/test_tutorial001.py | 3 +- - .../test_exceptions/test_tutorial001.py | 7 +-- - .../test_exceptions/test_tutorial002.py | 7 +-- - .../test_exceptions/test_tutorial003.py | 5 +- - .../test_exceptions/test_tutorial004.py | 5 +- - .../test_first_steps/test_tutorial001.py | 3 +- - .../test_first_steps/test_tutorial002.py | 3 +- - .../test_first_steps/test_tutorial003.py | 3 +- - .../test_first_steps/test_tutorial004.py | 3 +- - .../test_first_steps/test_tutorial005.py | 3 +- - .../test_first_steps/test_tutorial006.py | 3 +- - .../test_tutorial001.py | 3 +- - .../test_tutorial002.py | 3 +- - .../test_multiple_options/test_tutorial001.py | 3 +- - .../test_multiple_options/test_tutorial002.py | 3 +- - .../test_tutorial001.py | 3 +- - .../test_callback/test_tutorial001.py | 3 +- - .../test_callback/test_tutorial003.py | 5 +- - .../test_callback/test_tutorial004.py | 5 +- - .../test_help/test_tutorial001.py | 3 +- - .../test_help/test_tutorial002.py | 3 +- - .../test_help/test_tutorial003.py | 3 +- - .../test_name/test_tutorial001.py | 3 +- - .../test_name/test_tutorial002.py | 3 +- - .../test_name/test_tutorial003.py | 3 +- - .../test_name/test_tutorial004.py | 3 +- - .../test_name/test_tutorial005.py | 3 +- - .../test_prompt/test_tutorial001.py | 3 +- - .../test_prompt/test_tutorial002.py | 3 +- - .../test_prompt/test_tutorial003.py | 3 +- - .../test_required/test_tutorial002.py | 3 +- - .../test_version/test_tutorial003.py | 5 +- - .../test_tutorial002.py | 5 +- - .../test_tutorial003.py | 5 +- - .../test_tutorial004.py | 5 +- - .../test_tutorial007.py | 5 +- - .../test_tutorial008.py | 5 +- - .../test_tutorial009.py | 5 +- - .../test_bool/test_tutorial001.py | 3 +- - .../test_bool/test_tutorial002.py | 3 +- - .../test_bool/test_tutorial003.py | 3 +- - .../test_bool/test_tutorial004.py | 3 +- - .../test_datetime/test_tutorial001.py | 3 +- - .../test_datetime/test_tutorial002.py | 3 +- - .../test_enum/test_tutorial001.py | 3 +- - .../test_enum/test_tutorial002.py | 3 +- - .../test_file/test_tutorial001.py | 3 +- - .../test_file/test_tutorial002.py | 3 +- - .../test_file/test_tutorial003.py | 3 +- - .../test_file/test_tutorial004.py | 3 +- - .../test_file/test_tutorial005.py | 3 +- - .../test_index/test_tutorial001.py | 3 +- - .../test_number/test_tutorial001.py | 3 +- - .../test_number/test_tutorial002.py | 3 +- - .../test_number/test_tutorial003.py | 3 +- - .../test_path/test_tutorial001.py | 3 +- - .../test_path/test_tutorial002.py | 3 +- - .../test_uuid/test_tutorial001.py | 3 +- - .../test_prompt/test_tutorial001.py | 3 +- - .../test_prompt/test_tutorial002.py | 3 +- - .../test_prompt/test_tutorial003.py | 3 +- - .../test_tutorial001.py | 3 +- - .../test_tutorial002.py | 3 +- - .../test_tutorial003.py | 3 +- - .../test_tutorial004.py | 3 +- - .../test_name_help/test_tutorial001.py | 3 +- - .../test_name_help/test_tutorial002.py | 3 +- - .../test_name_help/test_tutorial003.py | 3 +- - .../test_name_help/test_tutorial004.py | 3 +- - .../test_name_help/test_tutorial005.py | 3 +- - .../test_name_help/test_tutorial006.py | 3 +- - .../test_name_help/test_tutorial007.py | 3 +- - .../test_name_help/test_tutorial008.py | 3 +- - .../test_subcommands/test_tutorial001.py | 3 +- - .../test_subcommands/test_tutorial002.py | 3 +- - .../test_subcommands/test_tutorial003.py | 3 +- - .../test_terminating/test_tutorial001.py | 3 +- - .../test_terminating/test_tutorial002.py | 3 +- - .../test_terminating/test_tutorial003.py | 3 +- - .../test_tutorial/test_testing/test_app01.py | 3 +- - .../test_tutorial/test_testing/test_app02.py | 3 +- - .../test_tutorial/test_testing/test_app03.py | 3 +- - .../test_using_click/test_tutorial003.py | 3 +- - .../test_using_click/test_tutorial004.py | 3 +- - 130 files changed, 370 insertions(+), 177 deletions(-) - -diff --git a/tests/test_compat/test_option_get_help.py b/tests/test_compat/test_option_get_help.py -index fb01a6d..41a9d52 100644 ---- a/tests/test_compat/test_option_get_help.py -+++ b/tests/test_compat/test_option_get_help.py -@@ -1,5 +1,6 @@ - import os - import subprocess -+import sys - - import typer.core - from typer.testing import CliRunner -@@ -40,7 +41,7 @@ def test_coverage_call(): - - def test_completion(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, " "], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_completion/test_completion.py b/tests/test_completion/test_completion.py -index ee128a3..7f36547 100644 ---- a/tests/test_completion/test_completion.py -+++ b/tests/test_completion/test_completion.py -@@ -47,7 +47,7 @@ def test_install_completion(): - - def test_completion_invalid_instruction(): - result = subprocess.run( -- ["coverage", "run", mod.__file__], -+ [sys.executable, "-m", "coverage", "run", mod.__file__], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -63,7 +63,7 @@ def test_completion_invalid_instruction(): - - def test_completion_source_bash(): - result = subprocess.run( -- ["coverage", "run", mod.__file__], -+ [sys.executable, "-m", "coverage", "run", mod.__file__], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -81,7 +81,7 @@ def test_completion_source_bash(): - - def test_completion_source_invalid_shell(): - result = subprocess.run( -- ["coverage", "run", mod.__file__], -+ [sys.executable, "-m", "coverage", "run", mod.__file__], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -96,7 +96,7 @@ def test_completion_source_invalid_shell(): - - def test_completion_source_invalid_instruction(): - result = subprocess.run( -- ["coverage", "run", mod.__file__], -+ [sys.executable, "-m", "coverage", "run", mod.__file__], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -111,7 +111,7 @@ def test_completion_source_invalid_instruction(): - - def test_completion_source_zsh(): - result = subprocess.run( -- ["coverage", "run", mod.__file__], -+ [sys.executable, "-m", "coverage", "run", mod.__file__], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -126,7 +126,7 @@ def test_completion_source_zsh(): - - def test_completion_source_fish(): - result = subprocess.run( -- ["coverage", "run", mod.__file__], -+ [sys.executable, "-m", "coverage", "run", mod.__file__], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -141,7 +141,7 @@ def test_completion_source_fish(): - - def test_completion_source_powershell(): - result = subprocess.run( -- ["coverage", "run", mod.__file__], -+ [sys.executable, "-m", "coverage", "run", mod.__file__], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -159,7 +159,7 @@ def test_completion_source_powershell(): - - def test_completion_source_pwsh(): - result = subprocess.run( -- ["coverage", "run", mod.__file__], -+ [sys.executable, "-m", "coverage", "run", mod.__file__], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_completion/test_completion_complete.py b/tests/test_completion/test_completion_complete.py -index e4f8b7e..e3fbb31 100644 ---- a/tests/test_completion/test_completion_complete.py -+++ b/tests/test_completion/test_completion_complete.py -@@ -1,12 +1,13 @@ - import os - import subprocess -+import sys - - from docs_src.commands.help import tutorial001 as mod - - - def test_completion_complete_subcommand_bash(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, " "], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -23,7 +24,7 @@ def test_completion_complete_subcommand_bash(): - - def test_completion_complete_subcommand_bash_invalid(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, " "], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -40,7 +41,7 @@ def test_completion_complete_subcommand_bash_invalid(): - - def test_completion_complete_subcommand_zsh(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, " "], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -59,7 +60,7 @@ def test_completion_complete_subcommand_zsh(): - - def test_completion_complete_subcommand_zsh_files(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, " "], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -75,7 +76,7 @@ def test_completion_complete_subcommand_zsh_files(): - - def test_completion_complete_subcommand_fish(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, " "], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -95,7 +96,7 @@ def test_completion_complete_subcommand_fish(): - - def test_completion_complete_subcommand_fish_should_complete(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, " "], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -112,7 +113,7 @@ def test_completion_complete_subcommand_fish_should_complete(): - - def test_completion_complete_subcommand_fish_should_complete_no(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, " "], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -129,7 +130,7 @@ def test_completion_complete_subcommand_fish_should_complete_no(): - - def test_completion_complete_subcommand_powershell(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, " "], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -147,7 +148,7 @@ def test_completion_complete_subcommand_powershell(): - - def test_completion_complete_subcommand_pwsh(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, " "], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -165,7 +166,7 @@ def test_completion_complete_subcommand_pwsh(): - - def test_completion_complete_subcommand_noshell(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, " "], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_completion/test_completion_complete_no_help.py b/tests/test_completion/test_completion_complete_no_help.py -index c221b69..bf5762c 100644 ---- a/tests/test_completion/test_completion_complete_no_help.py -+++ b/tests/test_completion/test_completion_complete_no_help.py -@@ -1,12 +1,13 @@ - import os - import subprocess -+import sys - - from docs_src.commands.index import tutorial002 as mod - - - def test_completion_complete_subcommand_zsh(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, " "], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -23,7 +24,7 @@ def test_completion_complete_subcommand_zsh(): - - def test_completion_complete_subcommand_fish(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, " "], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -40,7 +41,7 @@ def test_completion_complete_subcommand_fish(): - - def test_completion_complete_subcommand_powershell(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, " "], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -56,7 +57,7 @@ def test_completion_complete_subcommand_powershell(): - - def test_completion_complete_subcommand_pwsh(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, " "], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_completion/test_completion_install.py b/tests/test_completion/test_completion_install.py -index d7c96b9..0856b9b 100644 ---- a/tests/test_completion/test_completion_install.py -+++ b/tests/test_completion/test_completion_install.py -@@ -1,5 +1,6 @@ - import os - import subprocess -+import sys - from pathlib import Path - from unittest import mock - -@@ -16,7 +17,7 @@ app.command()(mod.main) - - def test_completion_install_no_shell(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--install-completion"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--install-completion"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -39,7 +40,15 @@ def test_completion_install_bash(): - if bash_completion_path.is_file(): - text = bash_completion_path.read_text() - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--install-completion", "bash"], -+ [ -+ sys.executable, -+ "-m", -+ "coverage", -+ "run", -+ mod.__file__, -+ "--install-completion", -+ "bash", -+ ], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -74,7 +83,15 @@ def test_completion_install_zsh(): - if completion_path.is_file(): - text = completion_path.read_text() - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--install-completion", "zsh"], -+ [ -+ sys.executable, -+ "-m", -+ "coverage", -+ "run", -+ mod.__file__, -+ "--install-completion", -+ "zsh", -+ ], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -103,7 +120,15 @@ def test_completion_install_fish(): - Path.home() / f".config/fish/completions/{script_path.name}.fish" - ) - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--install-completion", "fish"], -+ [ -+ sys.executable, -+ "-m", -+ "coverage", -+ "run", -+ mod.__file__, -+ "--install-completion", -+ "fish", -+ ], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_completion/test_completion_show.py b/tests/test_completion/test_completion_show.py -index 6996fed..02e70cb 100644 ---- a/tests/test_completion/test_completion_show.py -+++ b/tests/test_completion/test_completion_show.py -@@ -1,12 +1,13 @@ - import os - import subprocess -+import sys - - from docs_src.commands.index import tutorial001 as mod - - - def test_completion_show_no_shell(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--show-completion"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--show-completion"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -25,7 +26,15 @@ def test_completion_show_no_shell(): - - def test_completion_show_bash(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--show-completion", "bash"], -+ [ -+ sys.executable, -+ "-m", -+ "coverage", -+ "run", -+ mod.__file__, -+ "--show-completion", -+ "bash", -+ ], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -43,7 +52,15 @@ def test_completion_show_bash(): - - def test_completion_source_zsh(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--show-completion", "zsh"], -+ [ -+ sys.executable, -+ "-m", -+ "coverage", -+ "run", -+ mod.__file__, -+ "--show-completion", -+ "zsh", -+ ], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -58,7 +75,15 @@ def test_completion_source_zsh(): - - def test_completion_source_fish(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--show-completion", "fish"], -+ [ -+ sys.executable, -+ "-m", -+ "coverage", -+ "run", -+ mod.__file__, -+ "--show-completion", -+ "fish", -+ ], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -73,7 +98,15 @@ def test_completion_source_fish(): - - def test_completion_source_powershell(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--show-completion", "powershell"], -+ [ -+ sys.executable, -+ "-m", -+ "coverage", -+ "run", -+ mod.__file__, -+ "--show-completion", -+ "powershell", -+ ], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -91,7 +124,15 @@ def test_completion_source_powershell(): - - def test_completion_source_pwsh(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--show-completion", "pwsh"], -+ [ -+ sys.executable, -+ "-m", -+ "coverage", -+ "run", -+ mod.__file__, -+ "--show-completion", -+ "pwsh", -+ ], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_others.py b/tests/test_others.py -index 689e1d2..fb41bdc 100644 ---- a/tests/test_others.py -+++ b/tests/test_others.py -@@ -1,5 +1,6 @@ - import os - import subprocess -+import sys - from pathlib import Path - from unittest import mock - -@@ -97,7 +98,7 @@ def test_callback_3_untyped_parameters(): - def test_completion_untyped_parameters(): - file_path = Path(__file__).parent / "assets/completion_no_types.py" - result = subprocess.run( -- ["coverage", "run", str(file_path)], -+ [sys.executable, "-m", "coverage", "run", str(file_path)], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -119,7 +120,7 @@ def test_completion_untyped_parameters(): - assert '"Carlos":"The writer of scripts."' in result.stdout - - result = subprocess.run( -- ["coverage", "run", str(file_path)], -+ [sys.executable, "-m", "coverage", "run", str(file_path)], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -130,7 +131,7 @@ def test_completion_untyped_parameters(): - def test_completion_untyped_parameters_different_order_correct_names(): - file_path = Path(__file__).parent / "assets/completion_no_types_order.py" - result = subprocess.run( -- ["coverage", "run", str(file_path)], -+ [sys.executable, "-m", "coverage", "run", str(file_path)], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -152,7 +153,7 @@ def test_completion_untyped_parameters_different_order_correct_names(): - assert '"Carlos":"The writer of scripts."' in result.stdout - - result = subprocess.run( -- ["coverage", "run", str(file_path)], -+ [sys.executable, "-m", "coverage", "run", str(file_path)], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_prog_name.py b/tests/test_prog_name.py -index 06dd8c8..58626c7 100644 ---- a/tests/test_prog_name.py -+++ b/tests/test_prog_name.py -@@ -1,11 +1,12 @@ - import subprocess -+import sys - from pathlib import Path - - - def test_custom_prog_name(): - file_path = Path(__file__).parent / "assets/prog_name.py" - result = subprocess.run( -- ["coverage", "run", str(file_path), "--help"], -+ [sys.executable, "-m", "coverage", "run", str(file_path), "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tracebacks.py b/tests/test_tracebacks.py -index 06c91fe..0289e9c 100644 ---- a/tests/test_tracebacks.py -+++ b/tests/test_tracebacks.py -@@ -1,12 +1,13 @@ - import os - import subprocess -+import sys - from pathlib import Path - - - def test_traceback_no_rich(): - file_path = Path(__file__).parent / "assets/type_error_no_rich.py" - result = subprocess.run( -- ["coverage", "run", str(file_path)], -+ [sys.executable, "-m", "coverage", "run", str(file_path)], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -26,7 +27,7 @@ def test_traceback_no_rich(): - def test_traceback_no_rich_short_disable(): - file_path = Path(__file__).parent / "assets/type_error_no_rich_short_disable.py" - result = subprocess.run( -- ["coverage", "run", str(file_path)], -+ [sys.executable, "-m", "coverage", "run", str(file_path)], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -46,7 +47,7 @@ def test_traceback_no_rich_short_disable(): - def test_unmodified_traceback(): - file_path = Path(__file__).parent / "assets/type_error_normal_traceback.py" - result = subprocess.run( -- ["coverage", "run", str(file_path)], -+ [sys.executable, "-m", "coverage", "run", str(file_path)], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_arguments/test_default/test_tutorial001.py b/tests/test_tutorial/test_arguments/test_default/test_tutorial001.py -index 0cb1809..00e5734 100644 ---- a/tests/test_tutorial/test_arguments/test_default/test_tutorial001.py -+++ b/tests/test_tutorial/test_arguments/test_default/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -33,7 +34,7 @@ def test_call_arg(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_arguments/test_default/test_tutorial002.py b/tests/test_tutorial/test_arguments/test_default/test_tutorial002.py -index c1b9e7d..11b096b 100644 ---- a/tests/test_tutorial/test_arguments/test_default/test_tutorial002.py -+++ b/tests/test_tutorial/test_arguments/test_default/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -35,7 +36,7 @@ def test_call_arg(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_arguments/test_envvar/test_tutorial001.py b/tests/test_tutorial/test_arguments/test_envvar/test_tutorial001.py -index f166602..1567e12 100644 ---- a/tests/test_tutorial/test_arguments/test_envvar/test_tutorial001.py -+++ b/tests/test_tutorial/test_arguments/test_envvar/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - import typer.core -@@ -53,7 +54,7 @@ def test_call_env_var_arg(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_arguments/test_envvar/test_tutorial002.py b/tests/test_tutorial/test_arguments/test_envvar/test_tutorial002.py -index b9f938a..ce960f4 100644 ---- a/tests/test_tutorial/test_arguments/test_envvar/test_tutorial002.py -+++ b/tests/test_tutorial/test_arguments/test_envvar/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -40,7 +41,7 @@ def test_call_env_var2(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_arguments/test_envvar/test_tutorial003.py b/tests/test_tutorial/test_arguments/test_envvar/test_tutorial003.py -index 1b56c61..396ebf2 100644 ---- a/tests/test_tutorial/test_arguments/test_envvar/test_tutorial003.py -+++ b/tests/test_tutorial/test_arguments/test_envvar/test_tutorial003.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -40,7 +41,7 @@ def test_call_env_var_arg(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_arguments/test_help/test_tutorial001.py b/tests/test_tutorial/test_arguments/test_help/test_tutorial001.py -index af90d3b..1822f62 100644 ---- a/tests/test_tutorial/test_arguments/test_help/test_tutorial001.py -+++ b/tests/test_tutorial/test_arguments/test_help/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - import typer.core -@@ -43,7 +44,7 @@ def test_call_arg(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_arguments/test_help/test_tutorial002.py b/tests/test_tutorial/test_arguments/test_help/test_tutorial002.py -index 6434eea..30a183e 100644 ---- a/tests/test_tutorial/test_arguments/test_help/test_tutorial002.py -+++ b/tests/test_tutorial/test_arguments/test_help/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -30,7 +31,7 @@ def test_call_arg(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_arguments/test_help/test_tutorial003.py b/tests/test_tutorial/test_arguments/test_help/test_tutorial003.py -index 64e4f51..9a1b8d1 100644 ---- a/tests/test_tutorial/test_arguments/test_help/test_tutorial003.py -+++ b/tests/test_tutorial/test_arguments/test_help/test_tutorial003.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -30,7 +31,7 @@ def test_call_arg(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_arguments/test_help/test_tutorial004.py b/tests/test_tutorial/test_arguments/test_help/test_tutorial004.py -index bb9ddbb..771fbaf 100644 ---- a/tests/test_tutorial/test_arguments/test_help/test_tutorial004.py -+++ b/tests/test_tutorial/test_arguments/test_help/test_tutorial004.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -30,7 +31,7 @@ def test_call_arg(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_arguments/test_help/test_tutorial005.py b/tests/test_tutorial/test_arguments/test_help/test_tutorial005.py -index 0b527e0..cf962bb 100644 ---- a/tests/test_tutorial/test_arguments/test_help/test_tutorial005.py -+++ b/tests/test_tutorial/test_arguments/test_help/test_tutorial005.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -28,7 +29,7 @@ def test_call_arg(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_arguments/test_help/test_tutorial006.py b/tests/test_tutorial/test_arguments/test_help/test_tutorial006.py -index e1a1b1e..1b4229e 100644 ---- a/tests/test_tutorial/test_arguments/test_help/test_tutorial006.py -+++ b/tests/test_tutorial/test_arguments/test_help/test_tutorial006.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -28,7 +29,7 @@ def test_call_arg(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_arguments/test_help/test_tutorial007.py b/tests/test_tutorial/test_arguments/test_help/test_tutorial007.py -index 2fb6444..3c6eddd 100644 ---- a/tests/test_tutorial/test_arguments/test_help/test_tutorial007.py -+++ b/tests/test_tutorial/test_arguments/test_help/test_tutorial007.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - import typer.core -@@ -28,7 +29,7 @@ def test_call_arg(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_arguments/test_help/test_tutorial008.py b/tests/test_tutorial/test_arguments/test_help/test_tutorial008.py -index ef560be..f26c6e7 100644 ---- a/tests/test_tutorial/test_arguments/test_help/test_tutorial008.py -+++ b/tests/test_tutorial/test_arguments/test_help/test_tutorial008.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - import typer.core -@@ -41,7 +42,7 @@ def test_call_arg(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_arguments/test_optional/test_tutorial001.py b/tests/test_tutorial/test_arguments/test_optional/test_tutorial001.py -index f6fb561..efcf8a1 100644 ---- a/tests/test_tutorial/test_arguments/test_optional/test_tutorial001.py -+++ b/tests/test_tutorial/test_arguments/test_optional/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - import typer.core -@@ -42,7 +43,7 @@ def test_call_arg(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_arguments/test_optional/test_tutorial002.py b/tests/test_tutorial/test_arguments/test_optional/test_tutorial002.py -index 9a2de95..c616d46 100644 ---- a/tests/test_tutorial/test_arguments/test_optional/test_tutorial002.py -+++ b/tests/test_tutorial/test_arguments/test_optional/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -31,7 +32,7 @@ def test_call_arg(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_commands/test_arguments/test_tutorial001.py b/tests/test_tutorial/test_commands/test_arguments/test_tutorial001.py -index a5615a0..f515669 100644 ---- a/tests/test_tutorial/test_commands/test_arguments/test_tutorial001.py -+++ b/tests/test_tutorial/test_commands/test_arguments/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -35,7 +36,7 @@ def test_delete(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_commands/test_callback/test_tutorial001.py b/tests/test_tutorial/test_commands/test_callback/test_tutorial001.py -index 52721f3..8bda783 100644 ---- a/tests/test_tutorial/test_commands/test_callback/test_tutorial001.py -+++ b/tests/test_tutorial/test_commands/test_callback/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer.core - from typer.testing import CliRunner -@@ -71,7 +72,7 @@ def test_wrong_verbose(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_commands/test_callback/test_tutorial002.py b/tests/test_tutorial/test_commands/test_callback/test_tutorial002.py -index 4fd4e1b..d8478d3 100644 ---- a/tests/test_tutorial/test_commands/test_callback/test_tutorial002.py -+++ b/tests/test_tutorial/test_commands/test_callback/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -18,7 +19,7 @@ def test_app(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_commands/test_callback/test_tutorial003.py b/tests/test_tutorial/test_commands/test_callback/test_tutorial003.py -index 3f13891..bf0e5f3 100644 ---- a/tests/test_tutorial/test_commands/test_callback/test_tutorial003.py -+++ b/tests/test_tutorial/test_commands/test_callback/test_tutorial003.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -23,7 +24,7 @@ def test_for_coverage(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_commands/test_callback/test_tutorial004.py b/tests/test_tutorial/test_commands/test_callback/test_tutorial004.py -index e2d1d2f..7943228 100644 ---- a/tests/test_tutorial/test_commands/test_callback/test_tutorial004.py -+++ b/tests/test_tutorial/test_commands/test_callback/test_tutorial004.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -25,7 +26,7 @@ def test_app(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_commands/test_context/test_tutorial001.py b/tests/test_tutorial/test_commands/test_context/test_tutorial001.py -index df15d7c..2e3c7b7 100644 ---- a/tests/test_tutorial/test_commands/test_context/test_tutorial001.py -+++ b/tests/test_tutorial/test_commands/test_context/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -25,7 +26,7 @@ def test_delete(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_commands/test_context/test_tutorial002.py b/tests/test_tutorial/test_commands/test_context/test_tutorial002.py -index 80556fc..6aab364 100644 ---- a/tests/test_tutorial/test_commands/test_context/test_tutorial002.py -+++ b/tests/test_tutorial/test_commands/test_context/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -31,7 +32,7 @@ def test_callback(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_commands/test_context/test_tutorial003.py b/tests/test_tutorial/test_commands/test_context/test_tutorial003.py -index 3b15d27..6d5b5c3 100644 ---- a/tests/test_tutorial/test_commands/test_context/test_tutorial003.py -+++ b/tests/test_tutorial/test_commands/test_context/test_tutorial003.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -31,7 +32,7 @@ def test_callback(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_commands/test_context/test_tutorial004.py b/tests/test_tutorial/test_commands/test_context/test_tutorial004.py -index 3546cc3..8ce5997 100644 ---- a/tests/test_tutorial/test_commands/test_context/test_tutorial004.py -+++ b/tests/test_tutorial/test_commands/test_context/test_tutorial004.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -20,7 +21,7 @@ def test_1(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_commands/test_help/test_tutorial001.py b/tests/test_tutorial/test_commands/test_help/test_tutorial001.py -index 339bd55..bad756c 100644 ---- a/tests/test_tutorial/test_commands/test_help/test_tutorial001.py -+++ b/tests/test_tutorial/test_commands/test_help/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -117,7 +118,7 @@ def test_init(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_commands/test_help/test_tutorial002.py b/tests/test_tutorial/test_commands/test_help/test_tutorial002.py -index dcadf53..f53b5fe 100644 ---- a/tests/test_tutorial/test_commands/test_help/test_tutorial002.py -+++ b/tests/test_tutorial/test_commands/test_help/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -48,7 +49,7 @@ def test_delete(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_commands/test_help/test_tutorial003.py b/tests/test_tutorial/test_commands/test_help/test_tutorial003.py -index 2be8331..7d5f47f 100644 ---- a/tests/test_tutorial/test_commands/test_help/test_tutorial003.py -+++ b/tests/test_tutorial/test_commands/test_help/test_tutorial003.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -36,7 +37,7 @@ def test_call(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_commands/test_help/test_tutorial004.py b/tests/test_tutorial/test_commands/test_help/test_tutorial004.py -index 59e6779..47b90d9 100644 ---- a/tests/test_tutorial/test_commands/test_help/test_tutorial004.py -+++ b/tests/test_tutorial/test_commands/test_help/test_tutorial004.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -51,7 +52,7 @@ def test_delete(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_commands/test_help/test_tutorial005.py b/tests/test_tutorial/test_commands/test_help/test_tutorial005.py -index e9227fc..4299d83 100644 ---- a/tests/test_tutorial/test_commands/test_help/test_tutorial005.py -+++ b/tests/test_tutorial/test_commands/test_help/test_tutorial005.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -52,7 +53,7 @@ def test_delete(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_commands/test_help/test_tutorial006.py b/tests/test_tutorial/test_commands/test_help/test_tutorial006.py -index 91bd5a9..14f0815 100644 ---- a/tests/test_tutorial/test_commands/test_help/test_tutorial006.py -+++ b/tests/test_tutorial/test_commands/test_help/test_tutorial006.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -43,7 +44,7 @@ def test_call(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_commands/test_help/test_tutorial007.py b/tests/test_tutorial/test_commands/test_help/test_tutorial007.py -index 15fdb5c..3a75304 100644 ---- a/tests/test_tutorial/test_commands/test_help/test_tutorial007.py -+++ b/tests/test_tutorial/test_commands/test_help/test_tutorial007.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -47,7 +48,7 @@ def test_call(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_commands/test_help/test_tutorial008.py b/tests/test_tutorial/test_commands/test_help/test_tutorial008.py -index 5d6c7ef..b460d9c 100644 ---- a/tests/test_tutorial/test_commands/test_help/test_tutorial008.py -+++ b/tests/test_tutorial/test_commands/test_help/test_tutorial008.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -24,7 +25,7 @@ def test_call(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_commands/test_index/test_tutorial001.py b/tests/test_tutorial/test_commands/test_index/test_tutorial001.py -index ddebe83..fee5e76 100644 ---- a/tests/test_tutorial/test_commands/test_index/test_tutorial001.py -+++ b/tests/test_tutorial/test_commands/test_index/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -23,7 +24,7 @@ def test_arg(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_commands/test_index/test_tutorial002.py b/tests/test_tutorial/test_commands/test_index/test_tutorial002.py -index 54e3451..b49e38b 100644 ---- a/tests/test_tutorial/test_commands/test_index/test_tutorial002.py -+++ b/tests/test_tutorial/test_commands/test_index/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -32,7 +33,7 @@ def test_delete(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_commands/test_name/test_tutorial001.py b/tests/test_tutorial/test_commands/test_name/test_tutorial001.py -index e66adf8..0dae24f 100644 ---- a/tests/test_tutorial/test_commands/test_name/test_tutorial001.py -+++ b/tests/test_tutorial/test_commands/test_name/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -31,7 +32,7 @@ def test_delete(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_commands/test_one_or_multiple/test_tutorial001.py b/tests/test_tutorial/test_commands/test_one_or_multiple/test_tutorial001.py -index 7ecc907..5e76dd9 100644 ---- a/tests/test_tutorial/test_commands/test_one_or_multiple/test_tutorial001.py -+++ b/tests/test_tutorial/test_commands/test_one_or_multiple/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -24,7 +25,7 @@ def test_command(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_commands/test_one_or_multiple/test_tutorial002.py b/tests/test_tutorial/test_commands/test_one_or_multiple/test_tutorial002.py -index eeb4bf3..8af2daf 100644 ---- a/tests/test_tutorial/test_commands/test_one_or_multiple/test_tutorial002.py -+++ b/tests/test_tutorial/test_commands/test_one_or_multiple/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -26,7 +27,7 @@ def test_command(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_commands/test_options/test_tutorial001.py b/tests/test_tutorial/test_commands/test_options/test_tutorial001.py -index d77ad3a..ce3307e 100644 ---- a/tests/test_tutorial/test_commands/test_options/test_tutorial001.py -+++ b/tests/test_tutorial/test_commands/test_options/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -88,7 +89,7 @@ def test_init(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_exceptions/test_tutorial001.py b/tests/test_tutorial/test_exceptions/test_tutorial001.py -index 644f415..0a4590b 100644 ---- a/tests/test_tutorial/test_exceptions/test_tutorial001.py -+++ b/tests/test_tutorial/test_exceptions/test_tutorial001.py -@@ -1,5 +1,6 @@ - import os - import subprocess -+import sys - from pathlib import Path - - from typer.testing import CliRunner -@@ -12,7 +13,7 @@ runner = CliRunner() - def test_traceback_rich(): - file_path = Path(mod.__file__) - result = subprocess.run( -- ["coverage", "run", str(file_path)], -+ [sys.executable, "-m", "coverage", "run", str(file_path)], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -34,7 +35,7 @@ def test_traceback_rich(): - def test_standard_traceback_env_var(): - file_path = Path(mod.__file__) - result = subprocess.run( -- ["coverage", "run", str(file_path)], -+ [sys.executable, "-m", "coverage", "run", str(file_path)], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -55,7 +56,7 @@ def test_standard_traceback_env_var(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_exceptions/test_tutorial002.py b/tests/test_tutorial/test_exceptions/test_tutorial002.py -index ff79d9b..66286e0 100644 ---- a/tests/test_tutorial/test_exceptions/test_tutorial002.py -+++ b/tests/test_tutorial/test_exceptions/test_tutorial002.py -@@ -1,5 +1,6 @@ - import os - import subprocess -+import sys - from pathlib import Path - - from typer.testing import CliRunner -@@ -12,7 +13,7 @@ runner = CliRunner() - def test_traceback_rich(): - file_path = Path(mod.__file__) - result = subprocess.run( -- ["coverage", "run", str(file_path), "secret"], -+ [sys.executable, "-m", "coverage", "run", str(file_path), "secret"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -34,7 +35,7 @@ def test_traceback_rich(): - def test_standard_traceback_env_var(): - file_path = Path(mod.__file__) - result = subprocess.run( -- ["coverage", "run", str(file_path), "secret"], -+ [sys.executable, "-m", "coverage", "run", str(file_path), "secret"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -55,7 +56,7 @@ def test_standard_traceback_env_var(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_exceptions/test_tutorial003.py b/tests/test_tutorial/test_exceptions/test_tutorial003.py -index 54157e1..51cb170 100644 ---- a/tests/test_tutorial/test_exceptions/test_tutorial003.py -+++ b/tests/test_tutorial/test_exceptions/test_tutorial003.py -@@ -1,5 +1,6 @@ - import os - import subprocess -+import sys - from pathlib import Path - - from typer.testing import CliRunner -@@ -12,7 +13,7 @@ runner = CliRunner() - def test_traceback_rich_pretty_short_disable(): - file_path = Path(mod.__file__) - result = subprocess.run( -- ["coverage", "run", str(file_path)], -+ [sys.executable, "-m", "coverage", "run", str(file_path)], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -33,7 +34,7 @@ def test_traceback_rich_pretty_short_disable(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_exceptions/test_tutorial004.py b/tests/test_tutorial/test_exceptions/test_tutorial004.py -index a9aa11f..bb575e4 100644 ---- a/tests/test_tutorial/test_exceptions/test_tutorial004.py -+++ b/tests/test_tutorial/test_exceptions/test_tutorial004.py -@@ -1,5 +1,6 @@ - import os - import subprocess -+import sys - from pathlib import Path - - from typer.testing import CliRunner -@@ -12,7 +13,7 @@ runner = CliRunner() - def test_rich_pretty_exceptions_disable(): - file_path = Path(mod.__file__) - result = subprocess.run( -- ["coverage", "run", str(file_path)], -+ [sys.executable, "-m", "coverage", "run", str(file_path)], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -31,7 +32,7 @@ def test_rich_pretty_exceptions_disable(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_first_steps/test_tutorial001.py b/tests/test_tutorial/test_first_steps/test_tutorial001.py -index 8c54385..4a465db 100644 ---- a/tests/test_tutorial/test_first_steps/test_tutorial001.py -+++ b/tests/test_tutorial/test_first_steps/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -17,7 +18,7 @@ def test_cli(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_first_steps/test_tutorial002.py b/tests/test_tutorial/test_first_steps/test_tutorial002.py -index da66066..7192545 100644 ---- a/tests/test_tutorial/test_first_steps/test_tutorial002.py -+++ b/tests/test_tutorial/test_first_steps/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -25,7 +26,7 @@ def test_2(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_first_steps/test_tutorial003.py b/tests/test_tutorial/test_first_steps/test_tutorial003.py -index 4006362..6c39d84 100644 ---- a/tests/test_tutorial/test_first_steps/test_tutorial003.py -+++ b/tests/test_tutorial/test_first_steps/test_tutorial003.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -25,7 +26,7 @@ def test_2(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_first_steps/test_tutorial004.py b/tests/test_tutorial/test_first_steps/test_tutorial004.py -index 9d8158c..c419bb9 100644 ---- a/tests/test_tutorial/test_first_steps/test_tutorial004.py -+++ b/tests/test_tutorial/test_first_steps/test_tutorial004.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -49,7 +50,7 @@ def test_formal_3(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_first_steps/test_tutorial005.py b/tests/test_tutorial/test_first_steps/test_tutorial005.py -index 9c9090b..816ab0c 100644 ---- a/tests/test_tutorial/test_first_steps/test_tutorial005.py -+++ b/tests/test_tutorial/test_first_steps/test_tutorial005.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -49,7 +50,7 @@ def test_formal_1(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_first_steps/test_tutorial006.py b/tests/test_tutorial/test_first_steps/test_tutorial006.py -index 560191e..08cafe7 100644 ---- a/tests/test_tutorial/test_first_steps/test_tutorial006.py -+++ b/tests/test_tutorial/test_first_steps/test_tutorial006.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -44,7 +45,7 @@ def test_formal_1(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial001.py b/tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial001.py -index d4effbc..315000b 100644 ---- a/tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial001.py -+++ b/tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -19,7 +20,7 @@ def test_main(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial002.py b/tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial002.py -index 7894511..88e2dfe 100644 ---- a/tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial002.py -+++ b/tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -47,7 +48,7 @@ def test_valid_args(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_multiple_values/test_multiple_options/test_tutorial001.py b/tests/test_tutorial/test_multiple_values/test_multiple_options/test_tutorial001.py -index 7b73c44..3c57bfd 100644 ---- a/tests/test_tutorial/test_multiple_values/test_multiple_options/test_tutorial001.py -+++ b/tests/test_tutorial/test_multiple_values/test_multiple_options/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -35,7 +36,7 @@ def test_3_user(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_multiple_values/test_multiple_options/test_tutorial002.py b/tests/test_tutorial/test_multiple_values/test_multiple_options/test_tutorial002.py -index 8c4df70..d30357e 100644 ---- a/tests/test_tutorial/test_multiple_values/test_multiple_options/test_tutorial002.py -+++ b/tests/test_tutorial/test_multiple_values/test_multiple_options/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -30,7 +31,7 @@ def test_2_number(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_multiple_values/test_options_with_multiple_values/test_tutorial001.py b/tests/test_tutorial/test_multiple_values/test_options_with_multiple_values/test_tutorial001.py -index 0e008d3..fcb2165 100644 ---- a/tests/test_tutorial/test_multiple_values/test_options_with_multiple_values/test_tutorial001.py -+++ b/tests/test_tutorial/test_multiple_values/test_options_with_multiple_values/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -44,7 +45,7 @@ def test_invalid_user(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_options/test_callback/test_tutorial001.py b/tests/test_tutorial/test_options/test_callback/test_tutorial001.py -index a319f11..f5a43d0 100644 ---- a/tests/test_tutorial/test_options/test_callback/test_tutorial001.py -+++ b/tests/test_tutorial/test_options/test_callback/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -25,7 +26,7 @@ def test_2(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_options/test_callback/test_tutorial003.py b/tests/test_tutorial/test_options/test_callback/test_tutorial003.py -index ea8a817..7726997 100644 ---- a/tests/test_tutorial/test_options/test_callback/test_tutorial003.py -+++ b/tests/test_tutorial/test_options/test_callback/test_tutorial003.py -@@ -1,5 +1,6 @@ - import os - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -27,7 +28,7 @@ def test_2(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -37,7 +38,7 @@ def test_script(): - - def test_completion(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, " "], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_options/test_callback/test_tutorial004.py b/tests/test_tutorial/test_options/test_callback/test_tutorial004.py -index d41bcc9..473cd9d 100644 ---- a/tests/test_tutorial/test_options/test_callback/test_tutorial004.py -+++ b/tests/test_tutorial/test_options/test_callback/test_tutorial004.py -@@ -1,5 +1,6 @@ - import os - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -27,7 +28,7 @@ def test_2(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -37,7 +38,7 @@ def test_script(): - - def test_completion(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, " "], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_options/test_help/test_tutorial001.py b/tests/test_tutorial/test_options/test_help/test_tutorial001.py -index f9f7d22..3e89d55 100644 ---- a/tests/test_tutorial/test_options/test_help/test_tutorial001.py -+++ b/tests/test_tutorial/test_options/test_help/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -40,7 +41,7 @@ def test_formal(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_options/test_help/test_tutorial002.py b/tests/test_tutorial/test_options/test_help/test_tutorial002.py -index e3d4b89..260d645 100644 ---- a/tests/test_tutorial/test_options/test_help/test_tutorial002.py -+++ b/tests/test_tutorial/test_options/test_help/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -36,7 +37,7 @@ def test_help(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_options/test_help/test_tutorial003.py b/tests/test_tutorial/test_options/test_help/test_tutorial003.py -index 3750612..f6a9826 100644 ---- a/tests/test_tutorial/test_options/test_help/test_tutorial003.py -+++ b/tests/test_tutorial/test_options/test_help/test_tutorial003.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -27,7 +28,7 @@ def test_help(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_options/test_name/test_tutorial001.py b/tests/test_tutorial/test_options/test_name/test_tutorial001.py -index 6122ccb..2690ff2 100644 ---- a/tests/test_tutorial/test_options/test_name/test_tutorial001.py -+++ b/tests/test_tutorial/test_options/test_name/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -27,7 +28,7 @@ def test_call(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_options/test_name/test_tutorial002.py b/tests/test_tutorial/test_options/test_name/test_tutorial002.py -index 3bf243a..5d50e67 100644 ---- a/tests/test_tutorial/test_options/test_name/test_tutorial002.py -+++ b/tests/test_tutorial/test_options/test_name/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -34,7 +35,7 @@ def test_call_long(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_options/test_name/test_tutorial003.py b/tests/test_tutorial/test_options/test_name/test_tutorial003.py -index 3da9985..7294709 100644 ---- a/tests/test_tutorial/test_options/test_name/test_tutorial003.py -+++ b/tests/test_tutorial/test_options/test_name/test_tutorial003.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -28,7 +29,7 @@ def test_call(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_options/test_name/test_tutorial004.py b/tests/test_tutorial/test_options/test_name/test_tutorial004.py -index b6621c5..b0f4b5c 100644 ---- a/tests/test_tutorial/test_options/test_name/test_tutorial004.py -+++ b/tests/test_tutorial/test_options/test_name/test_tutorial004.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -34,7 +35,7 @@ def test_call_long(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_options/test_name/test_tutorial005.py b/tests/test_tutorial/test_options/test_name/test_tutorial005.py -index 565e537..440c036 100644 ---- a/tests/test_tutorial/test_options/test_name/test_tutorial005.py -+++ b/tests/test_tutorial/test_options/test_name/test_tutorial005.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -46,7 +47,7 @@ def test_call_condensed_wrong_order(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_options/test_prompt/test_tutorial001.py b/tests/test_tutorial/test_options/test_prompt/test_tutorial001.py -index e4b3321..588bc97 100644 ---- a/tests/test_tutorial/test_options/test_prompt/test_tutorial001.py -+++ b/tests/test_tutorial/test_options/test_prompt/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -34,7 +35,7 @@ def test_help(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_options/test_prompt/test_tutorial002.py b/tests/test_tutorial/test_options/test_prompt/test_tutorial002.py -index 36babc8..fd2048f 100644 ---- a/tests/test_tutorial/test_options/test_prompt/test_tutorial002.py -+++ b/tests/test_tutorial/test_options/test_prompt/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -34,7 +35,7 @@ def test_help(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_options/test_prompt/test_tutorial003.py b/tests/test_tutorial/test_options/test_prompt/test_tutorial003.py -index 73ff1c2..ba3204a 100644 ---- a/tests/test_tutorial/test_options/test_prompt/test_tutorial003.py -+++ b/tests/test_tutorial/test_options/test_prompt/test_tutorial003.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -48,7 +49,7 @@ def test_help(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_options/test_required/test_tutorial002.py b/tests/test_tutorial/test_options/test_required/test_tutorial002.py -index 7c6957b..2e14a9f 100644 ---- a/tests/test_tutorial/test_options/test_required/test_tutorial002.py -+++ b/tests/test_tutorial/test_options/test_required/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - import typer.core -@@ -45,7 +46,7 @@ def test_help_no_rich(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_options/test_version/test_tutorial003.py b/tests/test_tutorial/test_options/test_version/test_tutorial003.py -index cb5c62e..a5a7060 100644 ---- a/tests/test_tutorial/test_options/test_version/test_tutorial003.py -+++ b/tests/test_tutorial/test_options/test_version/test_tutorial003.py -@@ -1,5 +1,6 @@ - import os - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -32,7 +33,7 @@ def test_3(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -42,7 +43,7 @@ def test_script(): - - def test_completion(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, " "], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_options_autocompletion/test_tutorial002.py b/tests/test_tutorial/test_options_autocompletion/test_tutorial002.py -index c9d1970..3dc81a7 100644 ---- a/tests/test_tutorial/test_options_autocompletion/test_tutorial002.py -+++ b/tests/test_tutorial/test_options_autocompletion/test_tutorial002.py -@@ -1,5 +1,6 @@ - import os - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -10,7 +11,7 @@ runner = CliRunner() - - def test_completion(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, " "], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -34,7 +35,7 @@ def test_1(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_options_autocompletion/test_tutorial003.py b/tests/test_tutorial/test_options_autocompletion/test_tutorial003.py -index 77fee38..e066523 100644 ---- a/tests/test_tutorial/test_options_autocompletion/test_tutorial003.py -+++ b/tests/test_tutorial/test_options_autocompletion/test_tutorial003.py -@@ -1,5 +1,6 @@ - import os - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -10,7 +11,7 @@ runner = CliRunner() - - def test_completion(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, " "], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -34,7 +35,7 @@ def test_1(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_options_autocompletion/test_tutorial004.py b/tests/test_tutorial/test_options_autocompletion/test_tutorial004.py -index f2d8dd3..1aaec9d 100644 ---- a/tests/test_tutorial/test_options_autocompletion/test_tutorial004.py -+++ b/tests/test_tutorial/test_options_autocompletion/test_tutorial004.py -@@ -1,5 +1,6 @@ - import os - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -10,7 +11,7 @@ runner = CliRunner() - - def test_completion(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, " "], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -34,7 +35,7 @@ def test_1(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_options_autocompletion/test_tutorial007.py b/tests/test_tutorial/test_options_autocompletion/test_tutorial007.py -index c8bc089..9af6681 100644 ---- a/tests/test_tutorial/test_options_autocompletion/test_tutorial007.py -+++ b/tests/test_tutorial/test_options_autocompletion/test_tutorial007.py -@@ -1,5 +1,6 @@ - import os - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -10,7 +11,7 @@ runner = CliRunner() - - def test_completion(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, " "], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -35,7 +36,7 @@ def test_1(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_options_autocompletion/test_tutorial008.py b/tests/test_tutorial/test_options_autocompletion/test_tutorial008.py -index 06a82af..78a787a 100644 ---- a/tests/test_tutorial/test_options_autocompletion/test_tutorial008.py -+++ b/tests/test_tutorial/test_options_autocompletion/test_tutorial008.py -@@ -1,5 +1,6 @@ - import os - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -10,7 +11,7 @@ runner = CliRunner() - - def test_completion(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, " "], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -37,7 +38,7 @@ def test_1(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_options_autocompletion/test_tutorial009.py b/tests/test_tutorial/test_options_autocompletion/test_tutorial009.py -index 692da7e..ee7918d 100644 ---- a/tests/test_tutorial/test_options_autocompletion/test_tutorial009.py -+++ b/tests/test_tutorial/test_options_autocompletion/test_tutorial009.py -@@ -1,5 +1,6 @@ - import os - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -10,7 +11,7 @@ runner = CliRunner() - - def test_completion(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, " "], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -@@ -37,7 +38,7 @@ def test_1(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial001.py b/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial001.py -index 6a526b7..cc4b454 100644 ---- a/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial001.py -+++ b/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -43,7 +44,7 @@ def test_invalid_no_force(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial002.py b/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial002.py -index 1ce4ca6..339ebce 100644 ---- a/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial002.py -+++ b/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - import typer.core -@@ -62,7 +63,7 @@ def test_invalid_no_accept(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial003.py b/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial003.py -index bfa0599..83226bd 100644 ---- a/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial003.py -+++ b/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial003.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -34,7 +35,7 @@ def test_no_force(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial004.py b/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial004.py -index fcc994a..a01034d 100644 ---- a/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial004.py -+++ b/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial004.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -38,7 +39,7 @@ def test_short_demo(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_parameter_types/test_datetime/test_tutorial001.py b/tests/test_tutorial/test_parameter_types/test_datetime/test_tutorial001.py -index 9fad723..f6be63e 100644 ---- a/tests/test_tutorial/test_parameter_types/test_datetime/test_tutorial001.py -+++ b/tests/test_tutorial/test_parameter_types/test_datetime/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -43,7 +44,7 @@ def test_invalid(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_parameter_types/test_datetime/test_tutorial002.py b/tests/test_tutorial/test_parameter_types/test_datetime/test_tutorial002.py -index 38ebd3c..ec8fc71 100644 ---- a/tests/test_tutorial/test_parameter_types/test_datetime/test_tutorial002.py -+++ b/tests/test_tutorial/test_parameter_types/test_datetime/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -25,7 +26,7 @@ def test_usa_weird_date_format(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial001.py b/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial001.py -index f79acc1..584b71a 100644 ---- a/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial001.py -+++ b/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -41,7 +42,7 @@ def test_invalid(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial002.py b/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial002.py -index 51686d0..293a176 100644 ---- a/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial002.py -+++ b/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -25,7 +26,7 @@ def test_mix(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_parameter_types/test_file/test_tutorial001.py b/tests/test_tutorial/test_parameter_types/test_file/test_tutorial001.py -index 4357c9f..061266a 100644 ---- a/tests/test_tutorial/test_parameter_types/test_file/test_tutorial001.py -+++ b/tests/test_tutorial/test_parameter_types/test_file/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - from pathlib import Path - - import typer -@@ -24,7 +25,7 @@ def test_main(tmpdir): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_parameter_types/test_file/test_tutorial002.py b/tests/test_tutorial/test_parameter_types/test_file/test_tutorial002.py -index 5556ccd..bbb7696 100644 ---- a/tests/test_tutorial/test_parameter_types/test_file/test_tutorial002.py -+++ b/tests/test_tutorial/test_parameter_types/test_file/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - from pathlib import Path - - import typer -@@ -26,7 +27,7 @@ def test_main(tmpdir): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_parameter_types/test_file/test_tutorial003.py b/tests/test_tutorial/test_parameter_types/test_file/test_tutorial003.py -index 1387ca2..ae452d0 100644 ---- a/tests/test_tutorial/test_parameter_types/test_file/test_tutorial003.py -+++ b/tests/test_tutorial/test_parameter_types/test_file/test_tutorial003.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - from pathlib import Path - - import typer -@@ -23,7 +24,7 @@ def test_main(tmpdir): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_parameter_types/test_file/test_tutorial004.py b/tests/test_tutorial/test_parameter_types/test_file/test_tutorial004.py -index 6ce004d..aa51f39 100644 ---- a/tests/test_tutorial/test_parameter_types/test_file/test_tutorial004.py -+++ b/tests/test_tutorial/test_parameter_types/test_file/test_tutorial004.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - from pathlib import Path - - import typer -@@ -27,7 +28,7 @@ def test_main(tmpdir): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_parameter_types/test_file/test_tutorial005.py b/tests/test_tutorial/test_parameter_types/test_file/test_tutorial005.py -index 841df52..7f79fd4 100644 ---- a/tests/test_tutorial/test_parameter_types/test_file/test_tutorial005.py -+++ b/tests/test_tutorial/test_parameter_types/test_file/test_tutorial005.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - from pathlib import Path - - import typer -@@ -29,7 +30,7 @@ def test_main(tmpdir): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_parameter_types/test_index/test_tutorial001.py b/tests/test_tutorial/test_parameter_types/test_index/test_tutorial001.py -index 14affe2..62d16a6 100644 ---- a/tests/test_tutorial/test_parameter_types/test_index/test_tutorial001.py -+++ b/tests/test_tutorial/test_parameter_types/test_index/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -44,7 +45,7 @@ def test_invalid(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_parameter_types/test_number/test_tutorial001.py b/tests/test_tutorial/test_parameter_types/test_number/test_tutorial001.py -index de1dec5..1e08f0d 100644 ---- a/tests/test_tutorial/test_parameter_types/test_number/test_tutorial001.py -+++ b/tests/test_tutorial/test_parameter_types/test_number/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - import typer.core -@@ -90,7 +91,7 @@ def test_negative_score(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_parameter_types/test_number/test_tutorial002.py b/tests/test_tutorial/test_parameter_types/test_number/test_tutorial002.py -index 8827cdf..2e33f2e 100644 ---- a/tests/test_tutorial/test_parameter_types/test_number/test_tutorial002.py -+++ b/tests/test_tutorial/test_parameter_types/test_number/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -33,7 +34,7 @@ def test_clamped(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_parameter_types/test_number/test_tutorial003.py b/tests/test_tutorial/test_parameter_types/test_number/test_tutorial003.py -index 904b8b0..3d0a741 100644 ---- a/tests/test_tutorial/test_parameter_types/test_number/test_tutorial003.py -+++ b/tests/test_tutorial/test_parameter_types/test_number/test_tutorial003.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -49,7 +50,7 @@ def test_verbose_short_3_condensed(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_parameter_types/test_path/test_tutorial001.py b/tests/test_tutorial/test_parameter_types/test_path/test_tutorial001.py -index 0617b57..a616d8f 100644 ---- a/tests/test_tutorial/test_parameter_types/test_path/test_tutorial001.py -+++ b/tests/test_tutorial/test_parameter_types/test_path/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - from pathlib import Path - - import typer -@@ -46,7 +47,7 @@ def test_dir(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_parameter_types/test_path/test_tutorial002.py b/tests/test_tutorial/test_parameter_types/test_path/test_tutorial002.py -index 24499fa..97c7b7f 100644 ---- a/tests/test_tutorial/test_parameter_types/test_path/test_tutorial002.py -+++ b/tests/test_tutorial/test_parameter_types/test_path/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - from pathlib import Path - - import typer -@@ -39,7 +40,7 @@ def test_dir(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_parameter_types/test_uuid/test_tutorial001.py b/tests/test_tutorial/test_parameter_types/test_uuid/test_tutorial001.py -index 5bf406c..b22ad12 100644 ---- a/tests/test_tutorial/test_parameter_types/test_uuid/test_tutorial001.py -+++ b/tests/test_tutorial/test_parameter_types/test_uuid/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -33,7 +34,7 @@ def test_invalid_uuid(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_prompt/test_tutorial001.py b/tests/test_tutorial/test_prompt/test_tutorial001.py -index 42cbdfc..00c9061 100644 ---- a/tests/test_tutorial/test_prompt/test_tutorial001.py -+++ b/tests/test_tutorial/test_prompt/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -20,7 +21,7 @@ def test_cli(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_prompt/test_tutorial002.py b/tests/test_tutorial/test_prompt/test_tutorial002.py -index c8a4f3d..1d3aa91 100644 ---- a/tests/test_tutorial/test_prompt/test_tutorial002.py -+++ b/tests/test_tutorial/test_prompt/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -28,7 +29,7 @@ def test_no_confirm(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_prompt/test_tutorial003.py b/tests/test_tutorial/test_prompt/test_tutorial003.py -index 186f1fb..b34d823 100644 ---- a/tests/test_tutorial/test_prompt/test_tutorial003.py -+++ b/tests/test_tutorial/test_prompt/test_tutorial003.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -27,7 +28,7 @@ def test_no_confirm(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial001.py b/tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial001.py -index e08e273..f4bdf5e 100644 ---- a/tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial001.py -+++ b/tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -18,7 +19,7 @@ def test_cli(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial002.py b/tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial002.py -index 6fdd5b2..301142d 100644 ---- a/tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial002.py -+++ b/tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -18,7 +19,7 @@ def test_cli(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial003.py b/tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial003.py -index 4f92cc8..7ac342d 100644 ---- a/tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial003.py -+++ b/tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial003.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -23,7 +24,7 @@ def test_for_coverage(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial004.py b/tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial004.py -index fb4b062..e2d23d0 100644 ---- a/tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial004.py -+++ b/tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial004.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -25,7 +26,7 @@ def test_for_coverage(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial001.py b/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial001.py -index f8bc9bf..dfdb9f4 100644 ---- a/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial001.py -+++ b/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -31,7 +32,7 @@ def test_command(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial002.py b/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial002.py -index dd9a9e8..dc81bd9 100644 ---- a/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial002.py -+++ b/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -31,7 +32,7 @@ def test_command(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial003.py b/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial003.py -index 6d86e0f..af60a9e 100644 ---- a/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial003.py -+++ b/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial003.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -31,7 +32,7 @@ def test_command(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial004.py b/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial004.py -index db1ff39..75e3ce4 100644 ---- a/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial004.py -+++ b/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial004.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -31,7 +32,7 @@ def test_command(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial005.py b/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial005.py -index b122408..5b56974 100644 ---- a/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial005.py -+++ b/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial005.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -31,7 +32,7 @@ def test_command(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial006.py b/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial006.py -index e9e06bf..4b0b916 100644 ---- a/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial006.py -+++ b/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial006.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -31,7 +32,7 @@ def test_command(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial007.py b/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial007.py -index 3371372..faffc70 100644 ---- a/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial007.py -+++ b/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial007.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -31,7 +32,7 @@ def test_command(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial008.py b/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial008.py -index caec261..6a4d238 100644 ---- a/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial008.py -+++ b/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial008.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -31,7 +32,7 @@ def test_command(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_subcommands/test_tutorial001.py b/tests/test_tutorial/test_subcommands/test_tutorial001.py -index 5e1d1b4..c4fca5b 100644 ---- a/tests/test_tutorial/test_subcommands/test_tutorial001.py -+++ b/tests/test_tutorial/test_subcommands/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import pytest - from typer.testing import CliRunner -@@ -86,7 +87,7 @@ def test_scripts(mod): - - for module in [mod, items, users]: - result = subprocess.run( -- ["coverage", "run", module.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", module.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_subcommands/test_tutorial002.py b/tests/test_tutorial/test_subcommands/test_tutorial002.py -index d6f32f3..3e1607d 100644 ---- a/tests/test_tutorial/test_subcommands/test_tutorial002.py -+++ b/tests/test_tutorial/test_subcommands/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from typer.testing import CliRunner - -@@ -69,7 +70,7 @@ def test_users_delete(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_subcommands/test_tutorial003.py b/tests/test_tutorial/test_subcommands/test_tutorial003.py -index 770da97..f31e46d 100644 ---- a/tests/test_tutorial/test_subcommands/test_tutorial003.py -+++ b/tests/test_tutorial/test_subcommands/test_tutorial003.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import pytest - from typer.testing import CliRunner -@@ -159,7 +160,7 @@ def test_scripts(mod): - - for module in [mod, items, lands, reigns, towns, users]: - result = subprocess.run( -- ["coverage", "run", module.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", module.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_terminating/test_tutorial001.py b/tests/test_tutorial/test_terminating/test_tutorial001.py -index 1030c8b..f6651eb 100644 ---- a/tests/test_tutorial/test_terminating/test_tutorial001.py -+++ b/tests/test_tutorial/test_terminating/test_tutorial001.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -35,7 +36,7 @@ def test_existing_no_standalone(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_terminating/test_tutorial002.py b/tests/test_tutorial/test_terminating/test_tutorial002.py -index dd5b5e1..8c599fe 100644 ---- a/tests/test_tutorial/test_terminating/test_tutorial002.py -+++ b/tests/test_tutorial/test_terminating/test_tutorial002.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - from typer.testing import CliRunner -@@ -25,7 +26,7 @@ def test_root(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_terminating/test_tutorial003.py b/tests/test_tutorial/test_terminating/test_tutorial003.py -index da6ef4c..7a1909a 100644 ---- a/tests/test_tutorial/test_terminating/test_tutorial003.py -+++ b/tests/test_tutorial/test_terminating/test_tutorial003.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - import typer - import typer.core -@@ -44,7 +45,7 @@ def test_root_no_rich(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_testing/test_app01.py b/tests/test_tutorial/test_testing/test_app01.py -index 7e7b529..773941a 100644 ---- a/tests/test_tutorial/test_testing/test_app01.py -+++ b/tests/test_tutorial/test_testing/test_app01.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from docs_src.testing.app01 import main as mod - from docs_src.testing.app01.test_main import test_app -@@ -10,7 +11,7 @@ def test_app01(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_testing/test_app02.py b/tests/test_tutorial/test_testing/test_app02.py -index 429f4db..8c29d38 100644 ---- a/tests/test_tutorial/test_testing/test_app02.py -+++ b/tests/test_tutorial/test_testing/test_app02.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from docs_src.testing.app02 import main as mod - from docs_src.testing.app02.test_main import test_app -@@ -10,7 +11,7 @@ def test_app02(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_testing/test_app03.py b/tests/test_tutorial/test_testing/test_app03.py -index b8cecd9..aea281d 100644 ---- a/tests/test_tutorial/test_testing/test_app03.py -+++ b/tests/test_tutorial/test_testing/test_app03.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from docs_src.testing.app03 import main as mod - from docs_src.testing.app03.test_main import test_app -@@ -10,7 +11,7 @@ def test_app03(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_using_click/test_tutorial003.py b/tests/test_tutorial/test_using_click/test_tutorial003.py -index c3f33e2..6bc9bdf 100644 ---- a/tests/test_tutorial/test_using_click/test_tutorial003.py -+++ b/tests/test_tutorial/test_using_click/test_tutorial003.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from click.testing import CliRunner - -@@ -25,7 +26,7 @@ def test_click(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -diff --git a/tests/test_tutorial/test_using_click/test_tutorial004.py b/tests/test_tutorial/test_using_click/test_tutorial004.py -index ccec78b..06078d7 100644 ---- a/tests/test_tutorial/test_using_click/test_tutorial004.py -+++ b/tests/test_tutorial/test_using_click/test_tutorial004.py -@@ -1,4 +1,5 @@ - import subprocess -+import sys - - from click.testing import CliRunner - -@@ -31,7 +32,7 @@ def test_click_dropdb(): - - def test_script(): - result = subprocess.run( -- ["coverage", "run", mod.__file__, "--help"], -+ [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", --- -2.35.3 - diff --git a/set-proper-pythonpath-for-tutorial-script-tests.patch b/set-proper-pythonpath-for-tutorial-script-tests.patch index 3885102..e98d410 100644 --- a/set-proper-pythonpath-for-tutorial-script-tests.patch +++ b/set-proper-pythonpath-for-tutorial-script-tests.patch @@ -60,61 +60,38 @@ environment and that gets resolved by this commit: [ 123s] E + where '' = CompletedProcess(args=['coverage', 'run', '/home/abuild/rpmbuild/BUILD/typer-0.4.1/docs_src/subcommands/tutorial003/main.py', '--help'], returncode=1, stdout='', stderr='Traceback (most recent call last):\n File "/home/abuild/rpmbuild/BUILD/typer-0.4.1/docs_src/subcommands/tutorial003/main.py", line 3, in \n import items\nModuleNotFoundError: No module named \'items\'\n').stdout [ 123s] [ 123s] tests/test_tutorial/test_subcommands/test_tutorial003.py:146: AssertionError + --- - tests/test_tutorial/test_subcommands/test_tutorial001.py | 5 +++++ - tests/test_tutorial/test_subcommands/test_tutorial003.py | 5 +++++ - 2 files changed, 10 insertions(+) + tests/test_tutorial/test_subcommands/test_tutorial001.py | 2 +- + tests/test_tutorial/test_subcommands/test_tutorial003.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_tutorial/test_subcommands/test_tutorial001.py b/tests/test_tutorial/test_subcommands/test_tutorial001.py -index c4fca5b..1280e22 100644 +index 1280e22..6f86826 100644 --- a/tests/test_tutorial/test_subcommands/test_tutorial001.py +++ b/tests/test_tutorial/test_subcommands/test_tutorial001.py -@@ -1,3 +1,4 @@ -+import os - import subprocess - import sys - -@@ -85,11 +86,15 @@ def test_users_delete(app): - def test_scripts(mod): +@@ -87,7 +87,7 @@ def test_scripts(mod): from docs_src.subcommands.tutorial001 import items, users -+ env = os.environ.copy() + env = os.environ.copy() +- env["PYTHONPATH"] = ":".join(list(tutorial001.__path__)) + env["PYTHONPATH"] = ":".join(list(tutorial001.__path__) + [env["PYTHONPATH"]] if "PYTHONPATH" in env else []) -+ + for module in [mod, items, users]: result = subprocess.run( - [sys.executable, "-m", "coverage", "run", module.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -+ env=env, - ) - assert "Usage" in result.stdout diff --git a/tests/test_tutorial/test_subcommands/test_tutorial003.py b/tests/test_tutorial/test_subcommands/test_tutorial003.py -index 4db168b..eaf4539 100644 +index 2d6149c..0a05ae0 100644 --- a/tests/test_tutorial/test_subcommands/test_tutorial003.py +++ b/tests/test_tutorial/test_subcommands/test_tutorial003.py -@@ -1,3 +1,4 @@ -+import os - import subprocess - import sys - -@@ -137,11 +138,15 @@ def test_lands_towns_burn(app): - def test_scripts(mod): +@@ -160,7 +160,7 @@ def test_scripts(mod): from docs_src.subcommands.tutorial003 import items, lands, reigns, towns, users -+ env = os.environ.copy() + env = os.environ.copy() +- env["PYTHONPATH"] = ":".join(list(tutorial003.__path__)) + env["PYTHONPATH"] = ":".join(list(tutorial003.__path__) + [env["PYTHONPATH"]] if "PYTHONPATH" in env else []) -+ + for module in [mod, items, lands, reigns, towns, users]: result = subprocess.run( - [sys.executable, "-m", "coverage", "run", module.__file__, "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8", -+ env=env, - ) - assert "Usage" in result.stdout -- 2.35.3 diff --git a/typer-0.7.0.tar.gz b/typer-0.7.0.tar.gz deleted file mode 100644 index 8877aae..0000000 --- a/typer-0.7.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ff797846578a9f2a201b53442aedeb543319466870fbe1c701eab66dd7681165 -size 251871 diff --git a/typer-0.9.0.tar.gz b/typer-0.9.0.tar.gz new file mode 100644 index 0000000..1a02d18 --- /dev/null +++ b/typer-0.9.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50922fd79aea2f4751a8e0408ff10d2662bd0c8bbfa84755a699f3bada2978b2 +size 273985