Example #1
0
    def authorization(self, func):
        """ Define a authorization process. """
        if self.app is None:
            raise PluginException('The plugin must be installed to application.')

        self.authorize = muffin.to_coroutine(func)
        return func
Example #2
0
    def authorization(self, func):
        """ Define a authorization process. """
        if self.app is None:
            raise PluginException(
                'The plugin must be installed to application.')

        self.authorize = muffin.to_coroutine(func)
        return func
Example #3
0
def pytest_pyfunc_call(pyfuncitem):
    """Support for async tests."""
    if 'async' in pyfuncitem.keywords:
        loop_ = pyfuncitem.funcargs['loop']
        funcargs = pyfuncitem.funcargs
        testargs = {arg: funcargs[arg]
                    for arg in pyfuncitem._fixtureinfo.argnames}
        coro = muffin.to_coroutine(pyfuncitem.obj)
        loop_.run_until_complete(asyncio.async(coro(**testargs), loop=loop_))
Example #4
0
def pytest_pyfunc_call(pyfuncitem):
    """Support for async tests."""
    if 'async' in pyfuncitem.keywords:
        loop_ = pyfuncitem.funcargs['loop']
        funcargs = pyfuncitem.funcargs
        testargs = {arg: funcargs[arg]
                    for arg in pyfuncitem._fixtureinfo.argnames}
        coro = muffin.to_coroutine(pyfuncitem.obj)
        loop_.run_until_complete(asyncio.async(coro(**testargs), loop=loop_))