From 2e680e39bb3dfde7ef949d2cde686174ba926ec3 Mon Sep 17 00:00:00 2001 From: Stephan Jaensch Date: Mon, 5 Oct 2020 09:17:01 +0200 Subject: [PATCH] Make sure we use IPv4 for integration tests, they fail for bravado-asyncio on Python3.7+ otherwise --- bravado/testing/integration_test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bravado/testing/integration_test.py b/bravado/testing/integration_test.py index 5cd7a08..c21c86b 100644 --- a/bravado/testing/integration_test.py +++ b/bravado/testing/integration_test.py @@ -256,7 +256,7 @@ def redirect_test(): def run_bottle_server(port): """Wrapper function for bottle.run so that the child Python interpreter finds the bottle routes on Windows.""" - bottle.run(quiet=True, host='localhost', port=port) + bottle.run(quiet=True, host='127.0.0.1', port=port) class IntegrationTestingServicesAndClient: @@ -281,7 +281,7 @@ def wait_unit_service_starts(url, max_wait_time=10): ) try: web_service_process.start() - server_address = 'http://localhost:{port}'.format(port=port) + server_address = 'http://127.0.0.1:{port}'.format(port=port) wait_unit_service_starts(server_address, 10) yield server_address finally: @@ -289,7 +289,7 @@ def wait_unit_service_starts(url, max_wait_time=10): @pytest.fixture(scope='session') def not_answering_http_server(self): - yield 'http://localhost:{}'.format(ephemeral_port_reserve.reserve()) + yield 'http://127.0.0.1:{}'.format(ephemeral_port_reserve.reserve()) @pytest.fixture(params=['result', 'response']) def result_getter(self, request):