From de546590975ea53d44b28ca61833fdb5bda3ebee Mon Sep 17 00:00:00 2001 From: Malte Franken Date: Mon, 30 Mar 2020 07:40:09 +1100 Subject: [PATCH] Fix GeoNet NZ Quakes tests (#33383) * enable tests * only remove entity if exists --- homeassistant/components/geonetnz_quakes/geo_location.py | 3 ++- tests/ignore_uncaught_exceptions.py | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/geonetnz_quakes/geo_location.py b/homeassistant/components/geonetnz_quakes/geo_location.py index 7d29f5ed3ec..ed0b9f9f714 100644 --- a/homeassistant/components/geonetnz_quakes/geo_location.py +++ b/homeassistant/components/geonetnz_quakes/geo_location.py @@ -96,7 +96,8 @@ class GeonetnzQuakesEvent(GeolocationEvent): self._remove_signal_update() # Remove from entity registry. entity_registry = await async_get_registry(self.hass) - entity_registry.async_remove(self.entity_id) + if self.entity_id in entity_registry.entities: + entity_registry.async_remove(self.entity_id) @callback def _delete_callback(self): diff --git a/tests/ignore_uncaught_exceptions.py b/tests/ignore_uncaught_exceptions.py index e6dc2f7e4f5..b0feb2bddb3 100644 --- a/tests/ignore_uncaught_exceptions.py +++ b/tests/ignore_uncaught_exceptions.py @@ -51,8 +51,6 @@ IGNORE_UNCAUGHT_EXCEPTIONS = [ ("tests.components.dyson.test_fan", "test_purecool_update_state_filter_inv"), ("tests.components.dyson.test_fan", "test_purecool_component_setup_only_once"), ("tests.components.dyson.test_sensor", "test_purecool_component_setup_only_once"), - ("tests.components.geonetnz_quakes.test_geo_location", "test_setup"), - ("tests.components.geonetnz_quakes.test_sensor", "test_setup"), ("test_homeassistant_bridge", "test_homeassistant_bridge_fan_setup"), ("tests.components.hue.test_bridge", "test_handle_unauthorized"), ("tests.components.hue.test_init", "test_security_vuln_check"),