Skip to content

Commit

Permalink
Add env var to run completion installation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
svlandeg committed Sep 17, 2024
1 parent c04c555 commit a70ebff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ${@}
6 changes: 6 additions & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys
from os import getenv

import pytest

Expand All @@ -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",
)

0 comments on commit a70ebff

Please sign in to comment.