'Some versions of subunit don\'t have "addExpectedFailure". For these
versions, we report expected failures as successes.'

def test_subunitWithoutAddExpectedFailureInstalled(self):

    self.removeMethod(reporter.TestProtocolClient, 'addExpectedFailure')
    try:
        (1 / 0)
    except ZeroDivisionError:
        self.result.addExpectedFailure(self.test, sys.exc_info(), 'todo')
    expectedFailureOutput = self.stream.getvalue()
    self.stream.truncate(0)
    self.stream.seek(0)
    self.result.addSuccess(self.test)
    successOutput = self.stream.getvalue()
    self.assertEqual(successOutput, expectedFailureOutput)
