Merge lp:~cjwatson/storm/py3-mocker-inspect into lp:storm
Proposed by
Colin Watson
Status: | Merged |
---|---|
Merged at revision: | 525 |
Proposed branch: | lp:~cjwatson/storm/py3-mocker-inspect |
Merge into: | lp:storm |
Diff against target: |
96 lines (+49/-22) 1 file modified
storm/tests/mocker.py (+49/-22) |
To merge this branch: | bzr merge lp:~cjwatson/storm/py3-mocker-inspect |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Simon Poirier (community) | Approve | ||
Review via email: mp+371174@code.launchpad.net |
Commit message
Add Python 3 support to tests.mocker.
Description of the change
inspect.getargspec is deprecated on Python 3, and in any case causes us problems because it includes the bound first argument (self or similar) for bound methods. The modern inspect.signature API is for the most part much easier to use and doesn't have this problem.
There is one wrinkle which requires special handling: method descriptors don't have the first argument already bound as far as their signature is concerned, but for the purposes of a mock spec we want to skip it anyway.
To post a comment you must log in.
+1 Not the prettiest change, but seems ok.