1
0
mirror of https://github.com/esphome/esphome.git synced 2026-06-25 10:28:55 +02:00

[tests] Fix test_show_logs_serial taking 30s due to unmocked serial port wait (#14903)

This commit is contained in:
J. Nick Koston
2026-03-17 14:44:17 -10:00
committed by GitHub
parent b9e8da92c7
commit 3e845d387a

View File

@@ -167,6 +167,13 @@ def mock_run_miniterm() -> Generator[Mock]:
yield mock
@pytest.fixture
def mock_wait_for_serial_port() -> Generator[Mock]:
"""Mock _wait_for_serial_port for testing."""
with patch("esphome.__main__._wait_for_serial_port") as mock:
yield mock
@pytest.fixture
def mock_upload_using_esptool() -> Generator[Mock]:
"""Mock upload_using_esptool for testing."""
@@ -1706,6 +1713,7 @@ def test_show_logs_serial(
mock_get_port_type: Mock,
mock_check_permissions: Mock,
mock_run_miniterm: Mock,
mock_wait_for_serial_port: Mock,
) -> None:
"""Test show_logs with serial port."""
setup_core(config={"logger": {}}, platform=PLATFORM_ESP32)