Remove a redundant self argument in decorators

The wrapper function takes *func_args and **kwargs,
therefore, "self" argument is redundant.

Change-Id: Ibbe7acfe4cb91d4f1b26d96dbc5088a4720a2b56
This commit is contained in:
lkuchlan 2017-11-23 09:26:55 +02:00
parent 6d33d9f86c
commit f5c190535e
2 changed files with 4 additions and 4 deletions

View File

@ -78,7 +78,7 @@ def services(*args):
decorators.attr(type=list(args))(f)
@functools.wraps(f)
def wrapper(self, *func_args, **func_kwargs):
def wrapper(*func_args, **func_kwargs):
service_list = get_service_list()
for service in args:
@ -86,7 +86,7 @@ def services(*args):
msg = 'Skipped because the %s service is not available' % (
service)
raise testtools.TestCase.skipException(msg)
return f(self, *func_args, **func_kwargs)
return f(*func_args, **func_kwargs)
return wrapper
return decorator

View File

@ -56,9 +56,9 @@ def related_bug(bug, status_code=None):
"""
def decorator(f):
@functools.wraps(f)
def wrapper(self, *func_args, **func_kwargs):
def wrapper(*func_args, **func_kwargs):
try:
return f(self, *func_args, **func_kwargs)
return f(*func_args, **func_kwargs)
except Exception as exc:
exc_status_code = getattr(exc, 'status_code', None)
if status_code is None or status_code == exc_status_code: