From 9706f11f7456fd32e716fa1982457d9bb71ecb21 Mon Sep 17 00:00:00 2001 From: jessesightler-redhat Date: Fri, 28 Jun 2024 11:52:09 -0400 Subject: [PATCH] Fixed some ci failures --- kazoo/handlers/utils.py | 4 +++- kazoo/tests/test_utils.py | 10 +++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/kazoo/handlers/utils.py b/kazoo/handlers/utils.py index ac018944..47c82290 100644 --- a/kazoo/handlers/utils.py +++ b/kazoo/handlers/utils.py @@ -260,7 +260,9 @@ def create_tcp_connection( addrs = socket.getaddrinfo( address[0], address[1], 0, socket.SOCK_STREAM ) - conn = context.wrap_socket(module.socket(addrs[0][0]), server_hostname=hostname) + conn = context.wrap_socket( + module.socket(addrs[0][0]), server_hostname=hostname + ) conn.settimeout(timeout_at) conn.connect(address) sock = conn diff --git a/kazoo/tests/test_utils.py b/kazoo/tests/test_utils.py index 64795cea..f5f13e89 100644 --- a/kazoo/tests/test_utils.py +++ b/kazoo/tests/test_utils.py @@ -32,12 +32,16 @@ def test_timeout_arg(self): def test_ssl_server_hostname(self): from kazoo.handlers import utils - from kazoo.handlers.utils import create_tcp_connection, socket, ssl + from kazoo.handlers.utils import create_tcp_connection, ssl with patch.object(utils, "_set_default_tcpsock_options"): with patch.object(ssl.SSLContext, "wrap_socket") as wrap_socket: create_tcp_connection( - socket, ("127.0.0.1", 2181), timeout=1.5, hostname="fakehostname", use_ssl=True + socket, + ("127.0.0.1", 2181), + timeout=1.5, + hostname="fakehostname", + use_ssl=True ) for call_args in wrap_socket.call_args_list: @@ -49,7 +53,7 @@ def test_timeout_arg_eventlet(self): pytest.skip("eventlet handler not available.") from kazoo.handlers import utils - from kazoo.handlers.utils import create_tcp_connection, socket, time + from kazoo.handlers.utils import create_tcp_connection, time with patch.object(socket, "create_connection") as create_connection: with patch.object(utils, "_set_default_tcpsock_options"):