'L{defer.maybeDeferred} should catch exception raised by a synchronous
function and errback its resulting L{defer.Deferred} with it.'

def test_maybeDeferredSyncError(self):

    (S, E) = ([], [])
    try:
        ('10' + 5)
    except TypeError as e:
        expected = str(e)
    d = defer.maybeDeferred((lambda x: (x + 5)), '10')
    d.addCallbacks(S.append, E.append)
    self.assertEqual(S, [])
    self.assertEqual(len(E), 1)
    self.assertEqual(str(E[0].value), expected)
