Skip to content

Commit 411bd71

Browse files
Ruff
1 parent a5a5983 commit 411bd71

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

utilities/utilities.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import timeit
88
import unittest
99
from time import sleep, time
10-
from typing import Callable, ParamSpec, TypeVar
10+
from typing import Any, Callable, ParamSpec, TypeVar
1111

1212
import six
1313

@@ -44,7 +44,7 @@
4444
BASE_MEMORY_USAGE = "BASE_MEMORY_USAGE"
4545

4646

47-
def parameterized_list(cases: list[str]) -> list[str]:
47+
def parameterized_list(cases: list[Any]) -> list[tuple[str, Any]]:
4848
"""
4949
Creates a list of cases for parameterized to use to run tests.
5050
@@ -119,7 +119,7 @@ def _get_config_name() -> str:
119119
return get_config_details()["name"]
120120

121121

122-
def get_config_details() -> dict():
122+
def get_config_details() -> dict:
123123
"""
124124
Returns the current config name after waiting for up to WAIT_FOR_SERVER_TIMEOUT seconds
125125
for it to be readable
@@ -292,7 +292,7 @@ def _start_stop_ioc_is_a_start(is_a_start: bool, ioc_name: str) -> None:
292292
wait_for_ioc_start_stop(timeout=IOCS_START_STOP_TIMEOUT, is_start=is_a_start, ioc_name=ioc_name)
293293

294294

295-
def bulk_start_ioc(ioc_list: list[str]) -> tuple[bool, bool]:
295+
def bulk_start_ioc(ioc_list: list[str]) -> tuple[list[str], list[str]]:
296296
"""
297297
start a list of IOCs in bulk
298298
:param ioc_list: a list of the names of the IOCs to start
@@ -323,7 +323,7 @@ def bulk_start_ioc(ioc_list: list[str]) -> tuple[bool, bool]:
323323
return failed_to_start, not_in_proc_serv
324324

325325

326-
def bulk_stop_ioc(ioc_list: list[str]) -> bool:
326+
def bulk_stop_ioc(ioc_list: list[str]) -> list[str]:
327327
"""
328328
Stops a list of IOCs in bulk
329329
:param ioc_list: a list of the names of the IOCs to stop
@@ -482,16 +482,16 @@ def wait_for_string_pvs_to_not_be_empty(
482482
return pv_values
483483

484484

485-
def retry_on_failure(max_times: int) -> Callable[[], None]:
485+
def retry_on_failure(max_times: int) -> Callable[[Callable[P, T]], Callable[P, None]]:
486486
"""
487487
Decorator that will retry running a test if it failed.
488488
:param max_times: Maximum number of times to retry running the test
489489
:return: the decorator
490490
"""
491491

492-
def decorator(func: Callable[P, T]) -> Callable[P, T]:
492+
def decorator(func: Callable[P, T]) -> Callable[P, None]:
493493
@six.wraps(func)
494-
def wrapper(*args: P.args, **kwargs: P.kwargs) -> T:
494+
def wrapper(*args: P.args, **kwargs: P.kwargs) -> None:
495495
err = None
496496
for attempt in range(max_times):
497497
try:

0 commit comments

Comments
 (0)