From 11cf3973bfc64ab0b4e471fc56dae911df1ec8d9 Mon Sep 17 00:00:00 2001 From: Jeff Widman Date: Thu, 10 May 2018 16:12:19 -0700 Subject: Stop shadowing `ConnectionError` In Python3, `ConnectionError` is a native exception. So rename our custom one to `KafkaConnectionError` to prevent accidentally shadowing the native one. Note that there are still valid uses of `ConnectionError` in this code. They already expect a native Python3 `ConnectionError`, and also already handle the Python2 compatibility issues. --- test/test_conn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/test_conn.py') diff --git a/test/test_conn.py b/test/test_conn.py index 12a32ef..fbdeeb9 100644 --- a/test/test_conn.py +++ b/test/test_conn.py @@ -99,7 +99,7 @@ def test_send_disconnected(conn): conn.state = ConnectionStates.DISCONNECTED f = conn.send('foobar') assert f.failed() is True - assert isinstance(f.exception, Errors.ConnectionError) + assert isinstance(f.exception, Errors.KafkaConnectionError) def test_send_connecting(conn): @@ -162,7 +162,7 @@ def test_send_error(_socket, conn): _socket.send.side_effect = socket.error f = conn.send(req) assert f.failed() is True - assert isinstance(f.exception, Errors.ConnectionError) + assert isinstance(f.exception, Errors.KafkaConnectionError) assert _socket.close.call_count == 1 assert conn.state is ConnectionStates.DISCONNECTED -- cgit v1.2.1