@test.raises(AssertionError)
    def test_run_forever(self):
        class Controller(CementBaseController):
            class Meta:
                label = 'base'

            @expose()
            def runit(self):
                raise Exception("Fake some error")

        app = self.make_app(base_controller=Controller, argv=['runit'])

        def handler(signum, frame):
            raise AssertionError('It ran forever!')

        # set the signal handler and a 5-second alarm
        signal.signal(signal.SIGALRM, handler)
        signal.alarm(5)

        try:
            # this will run indefinitely
            with app as app:
                app.run_forever()
        except __HOLE__ as e:
            self.eq(e.args[0], 'It ran forever!')
            raise
        finally:
            signal.alarm(0)
dataset/ETHPy150Open datafolklabs/cement/tests/core/foundation_tests.py/FoundationTestCase.test_run_forever