Skip to content

Commit

Permalink
Don't use yield inside async def, fixes tests on Python 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
sjaensch committed Nov 17, 2017
1 parent bcefc7b commit 851e2ca
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/integration/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,21 @@


@pytest.fixture
async def swagger_client(integration_server, event_loop):
def swagger_client(integration_server, event_loop):
# Run all integration tests twice, once with our AsyncioClient and once again with the RequestsClient
# to make sure they both behave the same.
# Once this integration suite has become stable (i.e. we're happy with the approach and the test coverage)
# it could move to bravado and test all major HTTP clients (requests, fido, asyncio).
spec_url = '{}/swagger.yaml'.format(integration_server)
http_client = aiohttp_client.AiohttpClient(loop=event_loop)
yield await SwaggerClient.from_url(
spec_url,
http_client=http_client,
config={'also_return_response': True},
client = event_loop.run_until_complete(
SwaggerClient.from_url(
spec_url,
http_client=http_client,
config={'also_return_response': True},
)
)
yield client
http_client.client_session.close()


Expand Down

0 comments on commit 851e2ca

Please sign in to comment.