'A problem encountered while running a doctest is reported in the output
stream with a I{FAIL} or I{ERROR} tag along with a summary of what
problem was encountered and the ID of the test.'

def test_doctestError(self):

    from twisted.trial.test import erroneous
    suite = unittest.decorate(self.loader.loadDoctests(erroneous), itrial.ITestCase)
    output = self.getOutput(suite)
    path = 'twisted.trial.test.erroneous.unexpectedException'
    for substring in ['1/0', 'ZeroDivisionError', 'Exception    raised:', path]:
        self.assertSubstring(substring, output)
    self.assertTrue(re.search('Fail(ed|ure    in)    example:', output), "Couldn't    match    'Failure    in    example:    '    or    'Failed    example:    '")
    expect = [self.doubleSeparator, re.compile('\\[(ERROR|FAIL)\\]')]
    self.stringComparison(expect, output.splitlines())
