Merge lp:~jml/testtools/basic-mismatch into lp:~testtools-committers/testtools/trunk
Status: | Merged |
---|---|
Merged at revision: | 94 |
Proposed branch: | lp:~jml/testtools/basic-mismatch |
Merge into: | lp:~testtools-committers/testtools/trunk |
Diff against target: |
98 lines (+37/-3) 3 files modified
NEWS (+4/-1) testtools/matchers.py (+19/-2) testtools/tests/test_matchers.py (+14/-0) |
To merge this branch: | bzr merge lp:~jml/testtools/basic-mismatch |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Māris Fogels (community) | Approve | ||
testtools developers | Pending | ||
Review via email: mp+32872@code.launchpad.net |
Description of the change
This branch changes the base "Mismatch" so that it takes optional description and details parameters.
I wanted to do this because for a lot of Matchers I don't really want to make my own Mismatch subclass and I shouldn't need to.
As for implementation, I've preserved the old API, but am not particularly happy with the gymnastics required to do so. I could have my arm twisted to move the changes out of the base class and into a new class like SimpleMismatch. The reason I didn't is that I think Mismatch(
Māris points out that with this change, many of the Mismatch classes in testtools.matchers could disappear, along with their nice names.
Not a developer, but why did you use getatter() in Mismatch. get_details( )? It looks like the constructor guarantees that the object always has a valid ._details attribute.
I think the changes look good.
Maris