addUnexpectedSuccess and addExpectedFailure error out when used with trial

Bug #1517916 reported by Jonathan Lange
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Twisted
Unknown
Unknown
testtools
Won't Fix
Undecided
Unassigned

Bug Description

You can't reliably use testtools TestCases with trial, because Trial's reporter is incompatible with modern `addUnexpectedSuccess` and `addExpectedFailure` protocols

Trial's `IReporter` interface has the following:

```
    def addUnexpectedSuccess(test, todo):
    def addExpectedFailure(test, error, todo):
```

Where `todo` is a `Todo` object, and there are notes saying that it should just be a string.

testtools's result interface has:

```
    def addUnexpectedSuccess(test, details=None):
    def addExpectedFailure(test, err=None, details=None):
```

(edited for notation compatibility)

And when testtools wraps other results with ExtendedToOriginalDecorator, it anticipates the following signatures:

```
    # unexpected success
    def addUnexpectedSuccess(test, details):
    def addUnexpectedSuccess(test):
    def addFailure(test, err)

    # expected failure
    def addExpectedFailure(test, details):
    def addExpectedFailure(test, err):
    def addSuccess(test):
```

This is a plain messy compatibility issue. While it's not strictly a bug in testtools, testtools might well be the most effective place to fix it. There's precedent, in that we already have backwards compatibility code for legacy TestResults.

Tags: twisted
Revision history for this message
Jonathan Lange (jml) wrote :

Fixed in Twisted

Changed in testtools:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.