Skip to content
Snippets Groups Projects
Commit cd6d44ec authored by Paulus Schoutsen's avatar Paulus Schoutsen
Browse files

Properly clean up Home Assistant instances in tests

parent f4e0f1d8
No related branches found
No related tags found
No related merge requests found
...@@ -61,6 +61,7 @@ class TestBootstrap(unittest.TestCase): ...@@ -61,6 +61,7 @@ class TestBootstrap(unittest.TestCase):
self.assertTrue(os.path.isfile(check_file)) self.assertTrue(os.path.isfile(check_file))
bootstrap.process_ha_config_upgrade(hass) bootstrap.process_ha_config_upgrade(hass)
self.assertFalse(os.path.isfile(check_file)) self.assertFalse(os.path.isfile(check_file))
hass.stop()
def test_not_remove_lib_if_not_upgrade(self): def test_not_remove_lib_if_not_upgrade(self):
with tempfile.TemporaryDirectory() as config_dir: with tempfile.TemporaryDirectory() as config_dir:
...@@ -82,6 +83,7 @@ class TestBootstrap(unittest.TestCase): ...@@ -82,6 +83,7 @@ class TestBootstrap(unittest.TestCase):
bootstrap.process_ha_config_upgrade(hass) bootstrap.process_ha_config_upgrade(hass)
self.assertTrue(os.path.isfile(check_file)) self.assertTrue(os.path.isfile(check_file))
hass.stop()
def test_entity_customization(self): def test_entity_customization(self):
""" Test entity customization through config """ """ Test entity customization through config """
...@@ -102,6 +104,7 @@ class TestBootstrap(unittest.TestCase): ...@@ -102,6 +104,7 @@ class TestBootstrap(unittest.TestCase):
state = hass.states.get('test.test') state = hass.states.get('test.test')
self.assertTrue(state.attributes['hidden']) self.assertTrue(state.attributes['hidden'])
hass.stop()
def test_handle_setup_circular_dependency(self): def test_handle_setup_circular_dependency(self):
hass = get_test_home_assistant() hass = get_test_home_assistant()
...@@ -116,3 +119,4 @@ class TestBootstrap(unittest.TestCase): ...@@ -116,3 +119,4 @@ class TestBootstrap(unittest.TestCase):
bootstrap.setup_component(hass, 'comp_a') bootstrap.setup_component(hass, 'comp_a')
self.assertEqual(['comp_a'], hass.config.components) self.assertEqual(['comp_a'], hass.config.components)
hass.stop()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment