コード例 #1
0
ファイル: plugin.py プロジェクト: klen/muffin-admin
    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
コード例 #2
0
ファイル: plugin.py プロジェクト: lowks/muffin-admin
    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
コード例 #3
0
ファイル: pytest.py プロジェクト: MarSoft/muffin
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_))
コード例 #4
0
ファイル: pytest.py プロジェクト: simudream/muffin
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_))