'Some versions of subunit have "addExpectedFailure". For these
versions, when we call \'addExpectedFailure\' on the test result, we
pass the error and test through to the subunit client.'

def test_addExpectedFailurePassedThrough(self):

    addExpectedFailureCalls = []
    def addExpectedFailure(test, error):
        addExpectedFailureCalls.append((test, error))
    self.result._subunit.addExpectedFailure = addExpectedFailure
    try:
        (1 / 0)
    except ZeroDivisionError:
        exc_info = sys.exc_info()
        self.result.addExpectedFailure(self.test, exc_info, 'todo')
    self.assertEqual(addExpectedFailureCalls, [(self.test, exc_info)])
