

def assertFlattensImmediately(self, root, target):
    '\n        Assert that a root element, when flattened, is equal to a string, and\n        performs no asynchronus Deferred anything.\n\n        This version is more convenient in tests which wish to make multiple\n        assertions about flattening, since it can be called multiple times\n        without having to add multiple callbacks.\n\n        @return: the result of rendering L{root}, which should be equivalent to\n            L{target}.\n        @rtype: L{bytes}\n        '
    results = []
    it = self.assertFlattensTo(root, target)
    it.addBoth(results.append)
    self.addCleanup(it.cancel)
    if (not results):
        self.fail('Rendering did not complete immediately.')
    result = results[0]
    if isinstance(target, Failure):
        result.raiseException()
    return results[0]

dataset/ETHPy150Open twisted/twisted/twisted/web/test/_util.py FlattenTestCase.assertFlattensImmediately/VarMisuse@76/265 `result`->`target`