'An error raised by a callback creates a Failure.  The Failure captures
locals and globals if and only if C{Deferred.debug} is set.'

def test_errorInCallbackDoesNotCaptureVars(self):

    d = defer.Deferred()
    d.callback(None)
    defer.setDebugging(False)
    def raiseError(ignored):
        raise GenericError('Bang')
    d.addCallback(raiseError)
    l = []
    d.addErrback(l.append)
    fail = l[0]
    (localz, globalz) = fail.frames[0][(-2):]
    self.assertEqual([], localz)
    self.assertEqual([], globalz)
