diff --git a/scripts/test.sh b/scripts/test.sh index 32fa1e73f3..893dfde823 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -7,5 +7,7 @@ set -x export TERMINAL_WIDTH=3000 # Force disable terminal for tests inside of pytest, takes precedence over GITHUB_ACTIONS env var export _TYPER_FORCE_DISABLE_TERMINAL=1 +# Run autocompletion install tests in the CI +export _TYPER_RUN_INSTALL_COMPLETION_TESTS=1 # It seems xdist-pytest ensures modified sys.path to import relative modules in examples keeps working pytest --cov --cov-report=term-missing -o console_output_style=progress --numprocesses=auto ${@} diff --git a/tests/utils.py b/tests/utils.py index 8f51332ee2..019b006fa0 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1,4 +1,5 @@ import sys +from os import getenv import pytest @@ -25,3 +26,8 @@ needs_bash = pytest.mark.skipif( not shellingham or not shell or "bash" not in shell, reason="Test requires Bash" ) + +requires_completion_permission = pytest.mark.skipif( + not getenv("_TYPER_RUN_INSTALL_COMPLETION_TESTS", False), + reason="Test requires permission to run completion installation tests", +)