We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I currently migrate an application to click 8.x and have to migrate all the completion functions as well as the test code for shell completion.
My working code for click 7.x shell completion testing is based on @davidism answer on this post #1453 2 years ago and worked fine.
However, with click 8.x, there is no get_choices anymore and the documentation at https://click.palletsprojects.com/en/8.1.x/testing/ does not mention shell completion testing.
get_choices
Can you give me a new example or a link please?
This time I will prepare an MR for https://github.com/pallets/click/blob/8.1.x/docs/testing.rst :-)
The text was updated successfully, but these errors were encountered:
I mimicked the completion tests in Click itself to make up this kind of testing for annif CLI application, basically just the following:
annif
from click.shell_completion import ShellComplete def _get_completions(cli, args, incomplete): comp = ShellComplete(cli, {}, cli.name, "_ANNIF_COMPLETE") return comp.get_completions(args, incomplete) def _get_words(cli, args, incomplete): return [c.value for c in _get_completions(cli, args, incomplete)] def test_completion_base_all_options(): completions = _get_words(annif.cli.cli, [""], "--") assert completions == [ "--env-file", "--app", "--debug", "--no-debug", "--version", "--help", ] def test_completion_base_version_option(): completions = _get_words(annif.cli.cli, [""], "--ver") assert completions == [ "--version", ]
Sorry, something went wrong.
No branches or pull requests
I currently migrate an application to click 8.x and have to migrate all the completion functions as well as the test code for shell completion.
My working code for click 7.x shell completion testing is based on @davidism answer on this post #1453 2 years ago and worked fine.
However, with click 8.x, there is no
get_choices
anymore and the documentation athttps://click.palletsprojects.com/en/8.1.x/testing/ does not mention shell completion testing.
Can you give me a new example or a link please?
This time I will prepare an MR for https://github.com/pallets/click/blob/8.1.x/docs/testing.rst :-)
The text was updated successfully, but these errors were encountered: