'Create and return a reactor using C{self.reactorFactory}.'

def buildReactor(self):

    try:
        from twisted.internet.cfreactor import CFReactor
        from twisted.internet import reactor as globalReactor
    except ImportError:
        pass
    else:
        if (isinstance(globalReactor, CFReactor) and (self.reactorFactory is CFReactor)):
            raise SkipTest("CFReactor    uses    APIs    which    manipulate    global    state,    so    it's    not    safe    to    run    its    own    reactor-builder    tests    under    itself")
    try:
        reactor = self.reactorFactory()
    except:
        log.err(None, 'Failed    to    install    reactor')
        self.flushLoggedErrors()
        raise SkipTest(Failure().getErrorMessage())
    else:
        if (self.requiredInterfaces is not None):
            missing = [required for required in self.requiredInterfaces if (not required.providedBy(reactor))]
            if missing:
                self.unbuildReactor(reactor)
                raise SkipTest(('%s    does    not    provide    %s' % (fullyQualifiedName(reactor.__class__), ','.join([fullyQualifiedName(x) for x in missing]))))
    self.addCleanup(self.unbuildReactor, reactor)
    return reactor
