From 15889c905db49e24ab4011a51956608f05370bb1 Mon Sep 17 00:00:00 2001 From: Adam Smith <2105363+adamjs83@users.noreply.github.com> Date: Thu, 17 Sep 2026 17:56:35 -0400 Subject: [PATCH] fix: pin test_base_url.py entries to version 2 so migration is skipped MockConfigEntry defaults to version=1, which triggers async_migrate_integration on component setup; that legacy path indexes entry.data[CONF_API_KEY] directly and raised KeyError for the new optional-api-key entry in test_api_key_optional, before async_setup_entry (and thus AsyncOpenAI) was ever reached. Pin both entries in this file to version=2/minor_version=7, matching the config flow's current VERSION/MINOR_VERSION and conftest's mock_config_entry fixture. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01739Seac5eMAfNwFeiwV5r4 --- tests/test_base_url.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_base_url.py b/tests/test_base_url.py index 2e14217..2da5d6a 100644 --- a/tests/test_base_url.py +++ b/tests/test_base_url.py @@ -13,6 +13,8 @@ async def test_client_built_with_base_url(hass: HomeAssistant) -> None: entry = MockConfigEntry( domain=DOMAIN, data={"api_key": "sk-test", CONF_BASE_URL: "http://192.0.2.10:4000/v1"}, + version=2, + minor_version=7, ) entry.add_to_hass(hass) @@ -32,6 +34,8 @@ async def test_api_key_optional(hass: HomeAssistant) -> None: entry = MockConfigEntry( domain=DOMAIN, data={CONF_BASE_URL: "http://192.0.2.10:4000/v1"}, + version=2, + minor_version=7, ) entry.add_to_hass(hass)