示例#1
0
文件: async_test.py 项目: lowks/wpull
    def test_wait_future_timeout(self):
        @tornado.gen.coroutine
        def test_func():
            yield sleep(60.0)

        try:
            yield wait_future(test_func(), 0.1)
        except TimedOut:
            pass
        else:
            self.assertTrue(False)
示例#2
0
    def test_wait_future_timeout(self):
        @tornado.gen.coroutine
        def test_func():
            yield sleep(60.0)

        try:
            yield wait_future(test_func(), 0.1)
        except TimedOut:
            pass
        else:
            self.assertTrue(False)
示例#3
0
文件: async_test.py 项目: lowks/wpull
    def test_wait_future_error(self):
        @tornado.gen.coroutine
        def test_func():
            yield sleep(0.1)
            raise ValueError('uh-oh')

        try:
            yield wait_future(test_func(), 2.0)
        except ValueError as error:
            self.assertEqual('uh-oh', error.args[0])
        else:
            self.assertTrue(False)
示例#4
0
    def test_wait_future_error(self):
        @tornado.gen.coroutine
        def test_func():
            yield sleep(0.1)
            raise ValueError('uh-oh')

        try:
            yield wait_future(test_func(), 2.0)
        except ValueError as error:
            self.assertEqual('uh-oh', error.args[0])
        else:
            self.assertTrue(False)
示例#5
0
文件: async_test.py 项目: lowks/wpull
    def test_wait_future_none(self):
        @tornado.gen.coroutine
        def test_func():
            yield sleep(0.1)

        yield wait_future(test_func(), None)
示例#6
0
    def test_wait_future_none(self):
        @tornado.gen.coroutine
        def test_func():
            yield sleep(0.1)

        yield wait_future(test_func(), None)