diff --git a/script/component_test b/script/component_test new file mode 100755 index 0000000000..549c68fb25 --- /dev/null +++ b/script/component_test @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +set -x + +pytest tests/component_tests diff --git a/script/fulltest b/script/fulltest index 795482281a..a605beebfe 100755 --- a/script/fulltest +++ b/script/fulltest @@ -10,4 +10,5 @@ script/ci-custom.py script/lint-python script/lint-cpp script/unit_test +script/component_test script/test diff --git a/tests/component_tests/conftest.py b/tests/component_tests/conftest.py index 1676e3f0d4..aa564ed7b1 100644 --- a/tests/component_tests/conftest.py +++ b/tests/component_tests/conftest.py @@ -1,5 +1,13 @@ """Fixtures for component tests.""" +import sys +from pathlib import Path + +# Add package root to python path +here = Path(__file__).parent +package_root = here.parent.parent +sys.path.insert(0, package_root.as_posix()) + import pytest from esphome.core import CORE