fix(tests): ensure tests using _path_without_us() are skipped if pre-commit is installed system-wide

This commit is contained in:
Axel H 2021-10-22 19:17:57 +02:00
parent 78ccfbf863
commit e7fe7468dd
No known key found for this signature in database
GPG key ID: 01CFF828B72703A1
2 changed files with 11 additions and 0 deletions

View file

@ -12,6 +12,7 @@ from testing.auto_namedtuple import auto_namedtuple
TESTING_DIR = os.path.abspath(os.path.dirname(__file__))
SYSTEM_PATH = {'PATH': '/usr/bin:/usr/local/bin'}
def docker_is_running() -> bool: # pragma: win32 no cover
@ -84,6 +85,10 @@ skipif_cant_run_swift = pytest.mark.skipif(
parse_shebang.find_executable('swift') is None,
reason="swift isn't installed or can't be found",
)
skipif_pre_commit_system_install = pytest.mark.skipif(
bool(parse_shebang.find_executable('pre-commit', SYSTEM_PATH)),
reason='pre-commit is installed system-wide, this test will fail',
)
xfailif_windows = pytest.mark.xfail(os.name == 'nt', reason='windows')