

def test_returnValueNonLocalDeferred(self):
    '\n        L{returnValue} will emit a non-local warning in the case where the\n        L{inlineCallbacks}-decorated function has already yielded a Deferred\n        and therefore moved its generator function along.\n        '
    cause = Deferred()

    @inlineCallbacks
    def inline():
        (yield cause)
        self.mistakenMethod()
        returnValue(2)
    effect = inline()
    results = []
    effect.addCallback(effect.append)
    self.assertEquals(results, [])
    cause.callback(1)
    self.assertMistakenMethodWarning(results)

dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/internet/test/inlinecb_tests.py NonLocalExitTests.test_returnValueNonLocalDeferred/VarMisuse@61/148 `results`->`effect`