From ca4ca2c1740bf8b42978a8741682e3dc36045f84 Mon Sep 17 00:00:00 2001 From: svlandeg Date: Thu, 5 Sep 2024 14:38:38 +0200 Subject: [PATCH] remove test with shell_complete in Option --- tests/assets/compat_click7_8.py | 12 +----------- tests/test_compat/test_option_get_help.py | 18 ------------------ 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/tests/assets/compat_click7_8.py b/tests/assets/compat_click7_8.py index 74ba9e1672..29539b5ae4 100644 --- a/tests/assets/compat_click7_8.py +++ b/tests/assets/compat_click7_8.py @@ -1,28 +1,18 @@ -from typing import List - -import click import typer app = typer.Typer() -def shell_complete( - ctx: click.Context, param: click.Parameter, incomplete: str -) -> List[str]: - return ["Jonny"] - - @app.command(context_settings={"auto_envvar_prefix": "TEST"}) def main( name: str = typer.Option("John", hidden=True), lastname: str = typer.Option("Doe", "/lastname", show_default="Mr. Doe"), age: int = typer.Option(lambda: 42, show_default=True), - nickname: str = typer.Option("", shell_complete=shell_complete), ): """ Say hello. """ - print(f"Hello {name} {lastname}, it seems you have {age}, {nickname}") + print(f"Hello {name} {lastname}, it seems you have {age}") if __name__ == "__main__": diff --git a/tests/test_compat/test_option_get_help.py b/tests/test_compat/test_option_get_help.py index 362298b99a..343d2b16de 100644 --- a/tests/test_compat/test_option_get_help.py +++ b/tests/test_compat/test_option_get_help.py @@ -1,7 +1,3 @@ -import os -import subprocess -import sys - import typer.core from typer.testing import CliRunner @@ -37,17 +33,3 @@ def test_coverage_call(): result = runner.invoke(mod.app) assert result.exit_code == 0 assert "Hello John Doe, it seems you have 42" in result.output - - -def test_completion(): - result = subprocess.run( - [sys.executable, "-m", "coverage", "run", mod.__file__, " "], - capture_output=True, - encoding="utf-8", - env={ - **os.environ, - "_COMPAT_CLICK7_8.PY_COMPLETE": "complete_zsh", - "_TYPER_COMPLETE_ARGS": "compat_click7_8.py --nickname ", - }, - ) - assert "Jonny" in result.stdout