@pytest.fixture
def hass_recorder():
 hass = get_test_home_assistant()
 def setup_recorder(config):
  'Setup with params.'
  db_uri = 'sqlite://'
  conf = {recorder.CONF_DB_URL: db_uri}
  conf.update(config)
  assert setup_component(hass, recorder.DOMAIN, {recorder.DOMAIN: conf})
  hass.start()
  hass.block_till_done()
  recorder._verify_instance()
  recorder._INSTANCE.block_till_done()
  return hass
 (yield setup_recorder)
 hass.stop()

@ pytest . fixture def hass_recorder ( ) : hass = get_test_home_assistant ( ) def setup_recorder ( config ) : db_uri = 'sqlite://' conf = { recorder . CONF_DB_URL : db_uri } conf . update ( config ) assert setup_component ( hass , recorder . DOMAIN , { recorder . DOMAIN : conf } ) hass . start ( ) hass . block_till_done ( ) recorder . _verify_instance ( ) recorder . _INSTANCE . block_till_done ( ) return hass ( yield setup_recorder ) hass . stop ( )
hass fixture with in-memory recorder .