summaryrefslogtreecommitdiff
path: root/test/test_client_async.py
diff options
context:
space:
mode:
authorDana Powers <dana.powers@gmail.com>2019-04-01 19:38:48 -0700
committerGitHub <noreply@github.com>2019-04-01 19:38:48 -0700
commit51313d792a24059d003f5647ec531cfd9d62d7ab (patch)
tree2591e9ebfe8b5c23112074d08da647f2b7dffa0b /test/test_client_async.py
parentc02df4bcc6ee6920db1be259f44a8f958bb36791 (diff)
downloadkafka-python-51313d792a24059d003f5647ec531cfd9d62d7ab.tar.gz
Dont treat popped conn.close() as failure in state change callback (#1773)
Diffstat (limited to 'test/test_client_async.py')
-rw-r--r--test/test_client_async.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/test_client_async.py b/test/test_client_async.py
index 246e36c..0951cb4 100644
--- a/test/test_client_async.py
+++ b/test/test_client_async.py
@@ -93,6 +93,7 @@ def test_conn_state_change(mocker, cli, conn):
sel = mocker.patch.object(cli, '_selector')
node_id = 0
+ cli._conns[node_id] = conn
conn.state = ConnectionStates.CONNECTING
cli._conn_state_change(node_id, conn)
assert node_id in cli._connecting
@@ -180,8 +181,8 @@ def test_close(mocker, cli, conn):
# All node close
cli._maybe_connect(1)
cli.close()
- # +3 close: node 0, node 1, node bootstrap
- call_count += 3
+ # +2 close: node 1, node bootstrap (node 0 already closed)
+ call_count += 2
assert conn.close.call_count == call_count