INNER CODE UNIT · Python
version_check_cmd
dummylabs/thewatchman · scripts/test_ha.py:33
version_check_cmd = cmd + [
"python", "-c",
"import homeassistant.const as hc; print(f'\\n[+] Testing against Home Assistant Version: {hc.__version__}\\n')"
]
try:
# Run version check (this also primes the environment)
subprocess.run(version_check_cmd, check=True)
except subprocess.CalledProcessError:
print("[-] Failed to determine Home Assistant version.")
# 4. Run tests
test_cmd = cmd + ["pytest"] + pytest_args
print(f"Running: {' '.join(test_cmd)}")
try:
result = subprocess.run(test_cmd, check=True)
return result.returncode