Use TestCase.addCleanup (#36560)
This commit is contained in:
parent
85ba29012f
commit
c33edbe5bb
103 changed files with 179 additions and 254 deletions
|
@ -44,10 +44,7 @@ class TestComponentLogbook(unittest.TestCase):
|
|||
init_recorder_component(self.hass) # Force an in memory DB
|
||||
with patch("homeassistant.components.http.start_http_server_and_save_config"):
|
||||
assert setup_component(self.hass, logbook.DOMAIN, self.EMPTY_CONFIG)
|
||||
|
||||
def tearDown(self):
|
||||
"""Stop everything that was started."""
|
||||
self.hass.stop()
|
||||
self.addCleanup(self.hass.stop)
|
||||
|
||||
def test_service_call_create_logbook_entry(self):
|
||||
"""Test if service call create log book entry."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue