Skip to content
Myr

utils.py

This file

Path

tests/utils.py

27 lines · 624 bytes · Python

Last changed by

✅ Add `needs_bash` test fixture (#888)Sofie Van Landeghembefore adoptiona5b7557

History of this file

Take it

1import sys23import pytest45try:6    import shellingham7    from shellingham import ShellDetectionFailure89    shell = shellingham.detect_shell()[0]10except ImportError:  # pragma: no cover11    shellingham = None12    shell = None13except ShellDetectionFailure:  # pragma: no cover14    shell = None151617needs_py310 = pytest.mark.skipif(18    sys.version_info < (3, 10), reason="requires python3.10+"19)2021needs_linux = pytest.mark.skipif(22    not sys.platform.startswith("linux"), reason="Test requires Linux"23)2425needs_bash = pytest.mark.skipif(26    not shellingham or not shell or "bash" not in shell, reason="Test requires Bash"27)