Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Commit

Permalink
update decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
skoudoro committed Jan 10, 2022
1 parent c55e52b commit 5873f8d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mailerlite/testing.py
Original file line number Diff line number Diff line change
@@ -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.")

Expand Down

0 comments on commit 5873f8d

Please sign in to comment.