jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/548715 )
Change subject: [IMPR] Use functools.wraps to fix wrapper name ......................................................................
[IMPR] Use functools.wraps to fix wrapper name
Change-Id: Iedca2ce8e12bd68f509973bc6f2e071b22eef95c --- M tests/utils.py 1 file changed, 2 insertions(+), 1 deletion(-)
Approvals: Dvorapa: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/utils.py b/tests/utils.py index f11edd3..76b4091 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -7,6 +7,7 @@ # from __future__ import absolute_import, division, unicode_literals
+from functools import wraps import inspect import json import os @@ -84,6 +85,7 @@ This decorator runs the test and, if it is a failure, reports the result and considers it a skipped test. """ + @wraps(func) def wrapper(*args, **kwargs): try: func(*args, **kwargs) @@ -98,7 +100,6 @@ except Exception: pywikibot.exception(tb=True) raise unittest.SkipTest('Test is allowed to fail.') - wrapper.__name__ = func.__name__
if PY2: return unittest.expectedFailure(func)
pywikibot-commits@lists.wikimedia.org