diff --git a/tests/components/bmw_connected_drive/test_config_flow.py b/tests/components/bmw_connected_drive/test_config_flow.py index b562e2b898f..3c7f452a011 100644 --- a/tests/components/bmw_connected_drive/test_config_flow.py +++ b/tests/components/bmw_connected_drive/test_config_flow.py @@ -92,7 +92,7 @@ async def test_api_error(hass: HomeAssistant) -> None: result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": config_entries.SOURCE_USER}, - data=FIXTURE_USER_INPUT, + data=deepcopy(FIXTURE_USER_INPUT), ) assert result["type"] is FlowResultType.FORM @@ -116,7 +116,7 @@ async def test_full_user_flow_implementation(hass: HomeAssistant) -> None: result2 = await hass.config_entries.flow.async_init( DOMAIN, context={"source": config_entries.SOURCE_USER}, - data=FIXTURE_USER_INPUT, + data=deepcopy(FIXTURE_USER_INPUT), ) assert result2["type"] is FlowResultType.CREATE_ENTRY assert result2["title"] == FIXTURE_COMPLETE_ENTRY[CONF_USERNAME] @@ -137,7 +137,8 @@ async def test_options_flow_implementation(hass: HomeAssistant) -> None: return_value=True, ) as mock_setup_entry, ): - config_entry = MockConfigEntry(**FIXTURE_CONFIG_ENTRY) + config_entry_args = deepcopy(FIXTURE_CONFIG_ENTRY) + config_entry = MockConfigEntry(**config_entry_args) config_entry.add_to_hass(hass) await hass.config_entries.async_setup(config_entry.entry_id) diff --git a/tests/components/bmw_connected_drive/test_init.py b/tests/components/bmw_connected_drive/test_init.py index 52bc8a7ce05..5cd6362d6fa 100644 --- a/tests/components/bmw_connected_drive/test_init.py +++ b/tests/components/bmw_connected_drive/test_init.py @@ -1,5 +1,6 @@ """Test Axis component setup process.""" +from copy import deepcopy from unittest.mock import patch import pytest @@ -37,7 +38,7 @@ async def test_migrate_options( ) -> None: """Test successful migration of options.""" - config_entry = FIXTURE_CONFIG_ENTRY.copy() + config_entry = deepcopy(FIXTURE_CONFIG_ENTRY) config_entry["options"] = options mock_config_entry = MockConfigEntry(**config_entry) @@ -55,7 +56,7 @@ async def test_migrate_options( async def test_migrate_options_from_data(hass: HomeAssistant) -> None: """Test successful migration of options.""" - config_entry = FIXTURE_CONFIG_ENTRY.copy() + config_entry = deepcopy(FIXTURE_CONFIG_ENTRY) config_entry["options"] = {} config_entry["data"].update({CONF_READ_ONLY: False}) @@ -107,7 +108,8 @@ async def test_migrate_unique_ids( entity_registry: er.EntityRegistry, ) -> None: """Test successful migration of entity unique_ids.""" - mock_config_entry = MockConfigEntry(**FIXTURE_CONFIG_ENTRY) + confg_entry = deepcopy(FIXTURE_CONFIG_ENTRY) + mock_config_entry = MockConfigEntry(**confg_entry) mock_config_entry.add_to_hass(hass) entity: er.RegistryEntry = entity_registry.async_get_or_create( @@ -153,7 +155,8 @@ async def test_dont_migrate_unique_ids( entity_registry: er.EntityRegistry, ) -> None: """Test successful migration of entity unique_ids.""" - mock_config_entry = MockConfigEntry(**FIXTURE_CONFIG_ENTRY) + confg_entry = deepcopy(FIXTURE_CONFIG_ENTRY) + mock_config_entry = MockConfigEntry(**confg_entry) mock_config_entry.add_to_hass(hass) # create existing entry with new_unique_id @@ -196,7 +199,8 @@ async def test_remove_stale_devices( device_registry: dr.DeviceRegistry, ) -> None: """Test remove stale device registry entries.""" - mock_config_entry = MockConfigEntry(**FIXTURE_CONFIG_ENTRY) + config_entry = deepcopy(FIXTURE_CONFIG_ENTRY) + mock_config_entry = MockConfigEntry(**config_entry) mock_config_entry.add_to_hass(hass) device_registry.async_get_or_create(