From 0d684088a4e3cb76656b713209a6edcb4a3385d0 Mon Sep 17 00:00:00 2001 From: Ryan Malloy Date: Wed, 28 Jan 2026 15:46:55 -0700 Subject: [PATCH] Fix esptool skip condition to use shutil.which The test was hardcoded to check /usr/bin/esptool, but esptool lives in ~/.local/bin/ on this system. Use shutil.which() to properly search PATH. --- tests/test_config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index 4c8b8f4..d09c947 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -3,6 +3,7 @@ Test configuration management """ import os +import shutil from pathlib import Path import pytest @@ -74,11 +75,10 @@ def test_common_ports(): assert len(ports) > 0 # Should return some ports for any platform -@pytest.mark.skipif(not Path("/usr/bin/esptool").exists(), reason="esptool not found") +@pytest.mark.skipif(not shutil.which("esptool"), reason="esptool not found in PATH") def test_tool_availability(): """Test tool availability check""" config = ESPToolServerConfig() - # This should work if esptool is in PATH available = config._check_tool_availability("esptool") - assert isinstance(available, bool) + assert available is True