diff --git a/src/ad_test/test_file_change.py b/src/ad_test/test_file_change.py index 4db0c25..9f06417 100644 --- a/src/ad_test/test_file_change.py +++ b/src/ad_test/test_file_change.py @@ -30,21 +30,18 @@ def modify_file(path: Path): path.write_text(modified_content) -def test_file(ad: AppDaemon, caplog: pytest.LogCaptureFixture): +def test_file(ad: AppDaemon, caplog: pytest.LogCaptureFixture, config_repo: Repo): assert isinstance(ad, AppDaemon) - # ad.loop.run_until_complete(asyncio.sleep(2.0)) - module_file = Path(food.meal.__file__) - reset_file(module_file) modify_file(module_file) logging.getLogger('AppDaemon').propagate = True with caplog.at_level(logging.DEBUG, logger='AppDaemon._app_management'): - # running_ad.loop.run_until_complete(delayed_stop(running_ad, 2.0)) - print('waiting in test') - ad.loop.run_until_complete(asyncio.sleep(2.0)) + ad.loop.run_until_complete(asyncio.sleep(1.0)) - module_load_order = get_load_order(caplog) - assert module_load_order == ['food.meal', 'restaurant'] - print('done') + module_load_order = get_load_order(caplog) + assert module_load_order == ['food.meal', 'restaurant'] + + reset_file(module_file) + ad.loop.run_until_complete(asyncio.sleep(1.0))