@patch('twisted.internet.reactor')
    @inlineCallbacks
    def test_runner_no_run(self, fakereactor):
        fakereactor.connectTCP = Mock(side_effect=raise_error)
        runner = ApplicationRunner(u'ws://fake:1234/ws', u'dummy realm')

        try:
            yield runner.run(raise_error, start_reactor=False)
            self.fail()  # should have raise an exception, via Deferred

        except __HOLE__ as e:
            # make sure it's "our" exception
            self.assertEqual(e.args[0], "we always fail")

        # neither reactor.run() NOR reactor.stop() should have been called
        # (just connectTCP() will have been called)
        self.assertEqual(fakereactor.run.call_count, 0)
        self.assertEqual(fakereactor.stop.call_count, 0)
dataset/ETHPy150Open crossbario/autobahn-python/autobahn/twisted/test/test_application_runner.py/TestApplicationRunner.test_runner_no_run