From 0131f5b08fe0ba7efae2c708625cd23924a83275 Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Tue, 14 Mar 2023 10:17:31 -0500 Subject: [PATCH] add skipif to test that requires hardhat --- tests/test_features.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_features.py b/tests/test_features.py index 68a21a884..e14804b43 100644 --- a/tests/test_features.py +++ b/tests/test_features.py @@ -1,5 +1,7 @@ import inspect +import shutil from pathlib import Path +import pytest from crytic_compile import CryticCompile from crytic_compile.platform.solc_standard_json import SolcStandardJson @@ -23,6 +25,11 @@ def _run_all_detectors(slither: Slither) -> None: slither.run_detectors() +hardhat_available = shutil.which("hardhat") is not None + +@pytest.mark.skipif( + not hardhat_available, reason="requires Hardhat and project setup" +) def test_node() -> None: # hardhat must have been installed in tests/test_node_modules # For the CI its done through the github action config