Merge lp://staging/~cjwatson/storm/py3-mocker-inspect into lp://staging/storm

Proposed by Colin Watson
Status: Merged
Merged at revision: 525
Proposed branch: lp://staging/~cjwatson/storm/py3-mocker-inspect
Merge into: lp://staging/storm
Diff against target: 96 lines (+49/-22)
1 file modified
storm/tests/mocker.py (+49/-22)
To merge this branch: bzr merge lp://staging/~cjwatson/storm/py3-mocker-inspect
Reviewer Review Type Date Requested Status
Simon Poirier (community) Approve
Review via email: mp+371174@code.staging.launchpad.net

Commit message

Add Python 3 support to tests.mocker.SpecChecker.

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.
Revision history for this message
Simon Poirier (simpoir) wrote :

+1 Not the prettiest change, but seems ok.

review: Approve
513. By Colin Watson

Explain positional-only test.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to status/vote changes: