Merge lp:~elopio/u1-test-utils/logger_decorator into lp:u1-test-utils
Proposed by
Leo Arias
Status: | Merged |
---|---|
Approved by: | Natalia Bidart |
Approved revision: | 55 |
Merged at revision: | 45 |
Proposed branch: | lp:~elopio/u1-test-utils/logger_decorator |
Merge into: | lp:u1-test-utils |
Prerequisite: | lp:~elopio/u1-test-utils/assert_page_path |
Diff against target: |
221 lines (+99/-1) 3 files modified
u1testutils/sst/__init__.py (+24/-0) u1testutils/sst/selftests/unit/test_pages.py (+60/-1) u1testutils/sst/sso/pages.py (+15/-0) |
To merge this branch: | bzr merge lp:~elopio/u1-test-utils/logger_decorator |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Natalia Bidart (community) | Approve | ||
Review via email: mp+157925@code.launchpad.net |
Commit message
Added the actions logger decorator for the page objects.
To post a comment you must log in.
Looks good. About the decorator, instead of
11 + def log_and_call(*args, **kwargs): 0].__class_ _.__name_ _)
12 + class_name = str(args[
I would suggest using this approach, which is more explicit:
11 + def log_and_ call(instance, *args, **kwargs): __class_ _.__name_ _)
12 + class_name = str(instance.
...
25 + return method(instance, *args, **kwargs)
Futhermore, I would suggest adding a decorator that will receive the logging function as a param, thus allowing the caller to log using different levels. For example:
http:// bazaar. launchpad. net/~pycassos/ pycasa/ trunk/view/ head:/pycasa/ utils.py# L120
Nitpicking detail: there should be an empty blank line between the import <module> block and the from <module> import <feature> block.