Skip to content

Commit

Permalink
fix up test_utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodong-Yang committed Nov 28, 2024
1 parent f1be14b commit aaa1984
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/otaclient/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import time
import traceback
from pathlib import Path
from typing import Callable
from typing import Callable, Literal

from otaclient._types import OTAClientStatus
from otaclient_common._io import read_str_from_file, write_str_to_file_atomic
Expand All @@ -37,7 +37,7 @@ def wait_and_log(
check_flag: Callable[[], bool],
message: str = "",
*,
check_for: bool = True,
check_for: Literal[True] | Literal[False] = True,
check_interval: int = 2,
log_interval: int = 30,
log_func: Callable[[str], None] = logger.info,
Expand Down
3 changes: 2 additions & 1 deletion tests/test_otaclient/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ def test_wait_and_log(caplog: pytest.LogCaptureFixture):
_msg = "ticking flag"

wait_and_log(
_flag,
_flag.is_set,
_msg,
check_for=True,
check_interval=1,
log_interval=2,
log_func=logger.warning,
Expand Down

0 comments on commit aaa1984

Please sign in to comment.