Skip to content

Commit 6d3c453

Browse files
author
bjmb
committed
Fixed opened connections in test_session_host_parameter
1 parent e337ef2 commit 6d3c453

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

tests/integration/standard/test_cluster.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,23 @@ def test_session_host_parameter(self):
192192
193193
@test_category connection
194194
"""
195+
# Test with empty list
196+
cluster = Cluster(protocol_version=PROTOCOL_VERSION)
195197
with self.assertRaises(NoHostAvailable):
196-
Session(Cluster(protocol_version=PROTOCOL_VERSION), [])
198+
Session(cluster, [])
199+
cluster.shutdown()
200+
201+
# Test with only invalid
202+
cluster = Cluster(protocol_version=PROTOCOL_VERSION)
197203
with self.assertRaises(NoHostAvailable):
198-
Session(Cluster(protocol_version=PROTOCOL_VERSION), [Host("1.2.3.4", SimpleConvictionPolicy)])
199-
session = Session(Cluster(protocol_version=PROTOCOL_VERSION), [Host(x, SimpleConvictionPolicy) for x in
204+
Session(cluster, [Host("1.2.3.4", SimpleConvictionPolicy)])
205+
cluster.shutdown()
206+
207+
# Test with valid and invalid hosts
208+
cluster = Cluster(protocol_version=PROTOCOL_VERSION)
209+
Session(cluster, [Host(x, SimpleConvictionPolicy) for x in
200210
("127.0.0.1", "127.0.0.2", "1.2.3.4")])
201-
session.shutdown()
211+
cluster.shutdown()
202212

203213
def test_protocol_negotiation(self):
204214
"""

0 commit comments

Comments
 (0)