aboutsummaryrefslogtreecommitdiffstats
path: root/functest
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2017-05-14 08:50:32 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2017-05-14 08:58:09 +0200
commit0bbb24ff19753eca6f1e86dbf590b329d0b9c88c (patch)
treeaaa3adaae1f29713c77a6aecaa0bbc060e507163 /functest
parent6e0a0070d775cf5f266cda53eb7c004cecb0511c (diff)
Assign the wrapped function’s attributes
It mainly assigns to the wrapper push_results_to_db's __name__, __module__ and __doc__ and the documentation string. Change-Id: Idc882ac4e743699a4887e46c5066e0983c90afd9 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest')
-rw-r--r--functest/utils/decorators.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/functest/utils/decorators.py b/functest/utils/decorators.py
index 46ffe35d..bfbdf048 100644
--- a/functest/utils/decorators.py
+++ b/functest/utils/decorators.py
@@ -3,6 +3,7 @@
# pylint: disable=missing-docstring
import errno
+import functools
import os
import urlparse
@@ -41,6 +42,7 @@ def can_dump_request_to_file(method):
else:
return session.request(method=method, url=url, **kwargs)
+ @functools.wraps(method)
def hook(*args, **kwargs):
with mock.patch('requests.api.request', side_effect=patch_request):
return method(*args, **kwargs)