This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import wraps | |
def allow_simulate_exception(exception_class=Exception): | |
def _allow_simulate_exception(method): | |
"""Decorator that allows to raise an exception """ | |
@wraps(method) | |
def _raise_exception_if_method_name_fits(self, *method_args, | |
**method_kwargs): |