Skip to content

Commit c109e83

Browse files
author
tomcodegen
committed
crude fix; skip when no node/npm
1 parent 2d10ce4 commit c109e83

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

conftest.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,16 @@ def is_git_lfs_pointer(file_path: Path) -> bool:
8989
return False
9090

9191

92+
@pytest.hookimpl(hookwrapper=True)
93+
def pytest_runtest_makereport(item, call):
94+
outcome = yield
95+
report = outcome.get_result()
96+
97+
if report.when == "call" and report.failed:
98+
if "NodeJS or npm is not installed" in str(report.longrepr):
99+
pytest.skip("Test requires NodeJS and npm to be installed")
100+
101+
92102
@pytest.fixture(autouse=True)
93103
def skip_lfs_tests(request):
94104
"""Skip tests that depend on git LFS files if they haven't been pulled"""

0 commit comments

Comments
 (0)