diff --git a/tests/unittests/early_patches.py b/tests/unittests/early_patches.py index 8106c1b9efb..01b894d3e0a 100644 --- a/tests/unittests/early_patches.py +++ b/tests/unittests/early_patches.py @@ -1,12 +1,13 @@ import functools +from typing import Callable old_lru_cache = functools.lru_cache cached_functions = [] def wrapped_lru_cache(*args, **kwargs): - def wrapper(func): - new_func = old_lru_cache(*args, **kwargs)(func) + def wrapper(func: Callable, *a, **k): + new_func = old_lru_cache(*args, **kwargs)(func, *a, **k) # Without this check, we'll also store stdlib functions with @lru_cache if "cloudinit" in func.__module__: