diff --git a/.gitlab/ci/host-test.yml b/.gitlab/ci/host-test.yml index 968dcec1bf..f2ab6b89d2 100644 --- a/.gitlab/ci/host-test.yml +++ b/.gitlab/ci/host-test.yml @@ -365,6 +365,8 @@ test_pytest_macos: - "**/build*/build_log.txt" reports: junit: XUNIT_RESULT.xml + variables: + PYTEST_IGNORE_COLLECT_IMPORT_ERROR: "1" script: - run_cmd python tools/ci/ci_build_apps.py components examples tools/test_apps -vv --target linux diff --git a/tools/ci/idf_pytest/plugin.py b/tools/ci/idf_pytest/plugin.py index b2e04402c4..d88370792b 100644 --- a/tools/ci/idf_pytest/plugin.py +++ b/tools/ci/idf_pytest/plugin.py @@ -141,7 +141,7 @@ class IdfPytestEmbedded: def pytest_collectstart(self) -> None: # mock the optional packages while collecting locally - if not os.getenv('CI_JOB_ID'): + if not os.getenv('CI_JOB_ID') or os.getenv('PYTEST_IGNORE_COLLECT_IMPORT_ERROR') == '1': # optional packages required by test scripts for p in [ 'scapy',