Jyhess 80ca67cfda Python AIOHTTP server generator (#1470)
* Astract factory for generators based on connexion

* Add aiohttp server generator

* Fix flask tests

* Normalize python-flask folder names
2019-01-11 23:35:21 +08:00

18 lines
544 B
Python

import logging
import pytest
import os
import connexion
@pytest.fixture
def client(loop, aiohttp_client):
logging.getLogger('connexion.operation').setLevel('ERROR')
options = {
"swagger_ui": True
}
specification_dir = os.path.join(os.path.dirname(__file__), '..', 'openapi_server', 'openapi')
app = connexion.AioHttpApp(__name__, specification_dir=specification_dir, options=options)
app.add_api('openapi.yaml', pass_context_arg_name='request')
return loop.run_until_complete(aiohttp_client(app.app))