removed single use functions

This commit is contained in:
John Lancaster
2024-08-14 00:38:33 -05:00
parent 81da8be655
commit 6e793baed8
2 changed files with 23 additions and 26 deletions

View File

@@ -1,9 +1,11 @@
import asyncio
import re
from pathlib import Path
from typing import List
import pytest
from appdaemon.appdaemon import AppDaemon
from git import Repo
async def delayed_stop(ad: AppDaemon, delay: float):
@@ -39,3 +41,9 @@ def get_loaded_apps(caplog: pytest.LogCaptureFixture):
def count_error_lines(caplog: pytest.LogCaptureFixture) -> int:
error_log_lines = [msg for name, lvl, msg in caplog.record_tuples if name.startswith('Error')]
return len(error_log_lines)
def reset_file(repo: Repo, changed: Path):
if not changed.is_absolute():
changed = Path(repo.working_tree_dir) / changed
repo.git.checkout('HEAD', '--', changed)