refactored to use new function

This commit is contained in:
John Lancaster
2024-08-14 00:35:55 -05:00
parent 6c50657e5b
commit a0add54445

View File

@@ -5,7 +5,7 @@ from typing import List
import pytest import pytest
from appdaemon.appdaemon import AppDaemon from appdaemon.appdaemon import AppDaemon
from .utils import get_load_order from .utils import get_load_order, count_error_lines
def validate_app_dependencies(ad: AppDaemon): def validate_app_dependencies(ad: AppDaemon):
@@ -41,8 +41,7 @@ def test_startup(ad: AppDaemon, caplog: pytest.LogCaptureFixture):
with caplog.at_level(logging.DEBUG): with caplog.at_level(logging.DEBUG):
ad.loop.run_until_complete(asyncio.sleep(2.0)) ad.loop.run_until_complete(asyncio.sleep(2.0))
error_log_lines = [msg for name, lvl, msg in caplog.record_tuples if name.startswith('Error')] assert count_error_lines(caplog) == 0
assert len(error_log_lines) == 0
assert "Started 'hello_world'" in caplog.text assert "Started 'hello_world'" in caplog.text
assert 'App initialization complete' in caplog.text assert 'App initialization complete' in caplog.text