'As test_tracebackFromFailure, but covering more code.'

def test_traceback(self):

    class ErrorTest(SynchronousTestCase, ):
        exc_info = None
        def test_foo(self):
            try:
                (1 / 0)
            except ZeroDivisionError:
                self.exc_info = sys.exc_info()
                raise
    test = ErrorTest('test_foo')
    result = pyunit.TestResult()
    test.run(result)
    expected_stack = ''.join(traceback.format_tb(test.exc_info[2]))
    observed_stack = '\n'.join(result.errors[0][1].splitlines()[:(-1)])
    self.assertEqual(expected_stack.strip(), observed_stack[(- len(expected_stack)):].strip())
