Exemplo n.º 1
0
def test_is_future_generic():
    '''
    Returning an immediate value from as_future
    '''
    f = txaio.create_future('result')

    assert txaio.is_future(f)
Exemplo n.º 2
0
def test_is_future_generic(framework):
    '''
    Returning an immediate value from as_future
    '''
    f = txaio.create_future('result')

    assert txaio.is_future(f)
Exemplo n.º 3
0
def test_is_future_coroutine(framework_aio):
    '''
    Returning an immediate value from as_future
    '''
    pytest.importorskip('asyncio')  # 'aio' might be using trollius
    from asyncio import coroutine

    @coroutine
    def some_coroutine():
        yield 'answer'
    obj = some_coroutine()
    assert txaio.is_future(obj)
Exemplo n.º 4
0
def test_is_future_coroutine():
    '''
    Returning an immediate value from as_future
    '''
    pytest.importorskip('asyncio')
    if not txaio.using_asyncio:
        pytest.skip()

    from asyncio import coroutine

    @coroutine
    def some_coroutine():
        yield 'answer'
    obj = some_coroutine()
    assert txaio.is_future(obj)