Decorator that applies a decorator to all methods of a class.
Installing
pip install decorate-all-methods
Example Usage
fromdecorate_all_methodsimportdecorate_all_methodsfromtenacityimportretry,stop_after_attempt,wait_fixed@decorate_all_methods(retry(stop=stop_after_attempt(3),wait=wait_fixed(1)),exclude=['__init__'])classMyClass(object):def__init__(self,object):"""Will not be retried."""passdefforce_error(self):"""Will be retried 3 times."""assertFalsedefforce_another_error(self):"""Will also be retried 3 times."""assertFalse