diff --git a/mailerlite/testing.py b/mailerlite/testing.py index 97c297b..7f7a5be 100644 --- a/mailerlite/testing.py +++ b/mailerlite/testing.py @@ -1,13 +1,16 @@ """Utility function for unit tests.""" +from functools import wraps import pytest def succeed_or_skip_sensitive_tests(func): """Small decorator to skip some sensitive function.""" - def wrapper_func(): + @wraps(func) + def wrapper_func(*args, **kwargs): try: - func() - except Exception: + func(*args, **kwargs) + except Exception as e: + print(str(e)) pytest.skip("Test Failed due to an object deleted " "by another matrix.")