Skip to content
New issue

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

Tests: Add test to guarantee CLI is reachable #334

Merged
merged 2 commits into from
Feb 26, 2024
Merged

Tests: Add test to guarantee CLI is reachable #334

merged 2 commits into from
Feb 26, 2024

Conversation

sphuber
Copy link
Collaborator

@sphuber sphuber commented Feb 26, 2024

There are tests for the CLI but these use click's CliRunner which calls the commands directly from the Python API instead of calling the actual CLI script. This would not catch if the script is not properly installed or reachable. Here a test is added that tries to call the CLI through a subprocess, which simulates the real situation of a user invoking it.

Removing explicit `click_completion()` which is no longer needed for
modern versions of click.
There are tests for the CLI but these use click's `CliRunner` which
calls the commands directly from the Python API instead of calling the
actual CLI script. This would not catch if the script is not properly
installed or reachable. Here a test is added that tries to call the CLI
through a subprocess, which simulates the real situation of a user
invoking it.

This test would have caught the missing imports that were accidentally
removed by the `ruff` linter.
@sphuber sphuber merged commit 0743c3a into master Feb 26, 2024
10 checks passed
@sphuber sphuber deleted the fix/cli branch February 26, 2024 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant