Skip to content

Instantly share code, notes, and snippets.

View int8's full-sized avatar

Kamil int8

View GitHub Profile
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):