Skip to content

Commit

Permalink
CU-8695d4www: Fix allowing deprecation during test time
Browse files Browse the repository at this point in the history
  • Loading branch information
mart-r committed Aug 13, 2024
1 parent 927f807 commit fadc7d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ def __init__(self, func: Callable, msg: str,


def deprecation_exception_raiser(message: str, depr_version: Tuple[int, int, int],
removal_version: Tuple[int, int, int]):
removal_version: Tuple[int, int, int],
allow_usage: bool = False):
def decorator(func: Callable) -> Callable:
def wrapper(*args, **kwargs):
if ('allow_usage' in kwargs and kwargs['allow_usage'] or
len(args) >= 4 and args[3]):
if allow_usage:
return func(*args, **kwargs)
raise DeprecatedMethodCallException(func, message, depr_version, removal_version)
return wrapper
Expand Down

0 comments on commit fadc7d1

Please sign in to comment.