From a70ebff6e7a69d42946e191458667e3dd502b7f0 Mon Sep 17 00:00:00 2001 From: svlandeg Date: Tue, 17 Sep 2024 11:51:57 +0200 Subject: [PATCH] Add env var to run completion installation tests --- scripts/test.sh | 2 ++ tests/utils.py | 6 ++++++ 2 files changed, 8 insertions(+) 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", +)