@@ -44,14 +44,14 @@ def test_connection_creation(self):
4444 assert connection .kwargs == connection_kwargs
4545
4646 def test_multiple_connections (self , master_host ):
47- connection_kwargs = {'host' : master_host }
47+ connection_kwargs = {'host' : master_host [ 0 ], 'port' : master_host [ 1 ] }
4848 pool = self .get_pool (connection_kwargs = connection_kwargs )
4949 c1 = pool .get_connection ('_' )
5050 c2 = pool .get_connection ('_' )
5151 assert c1 != c2
5252
5353 def test_max_connections (self , master_host ):
54- connection_kwargs = {'host' : master_host }
54+ connection_kwargs = {'host' : master_host [ 0 ], 'port' : master_host [ 1 ] }
5555 pool = self .get_pool (max_connections = 2 ,
5656 connection_kwargs = connection_kwargs )
5757 pool .get_connection ('_' )
@@ -60,7 +60,7 @@ def test_max_connections(self, master_host):
6060 pool .get_connection ('_' )
6161
6262 def test_reuse_previously_released_connection (self , master_host ):
63- connection_kwargs = {'host' : master_host }
63+ connection_kwargs = {'host' : master_host [ 0 ], 'port' : master_host [ 1 ] }
6464 pool = self .get_pool (connection_kwargs = connection_kwargs )
6565 c1 = pool .get_connection ('_' )
6666 pool .release (c1 )
@@ -103,22 +103,23 @@ def get_pool(self, connection_kwargs=None, max_connections=10, timeout=20):
103103 return pool
104104
105105 def test_connection_creation (self , master_host ):
106- connection_kwargs = {'foo' : 'bar' , 'biz' : 'baz' , 'host' : master_host }
106+ connection_kwargs = {'foo' : 'bar' , 'biz' : 'baz' ,
107+ 'host' : master_host [0 ], 'port' : master_host [1 ]}
107108 pool = self .get_pool (connection_kwargs = connection_kwargs )
108109 connection = pool .get_connection ('_' )
109110 assert isinstance (connection , DummyConnection )
110111 assert connection .kwargs == connection_kwargs
111112
112113 def test_multiple_connections (self , master_host ):
113- connection_kwargs = {'host' : master_host }
114+ connection_kwargs = {'host' : master_host [ 0 ], 'port' : master_host [ 1 ] }
114115 pool = self .get_pool (connection_kwargs = connection_kwargs )
115116 c1 = pool .get_connection ('_' )
116117 c2 = pool .get_connection ('_' )
117118 assert c1 != c2
118119
119120 def test_connection_pool_blocks_until_timeout (self , master_host ):
120121 "When out of connections, block for timeout seconds, then raise"
121- connection_kwargs = {'host' : master_host }
122+ connection_kwargs = {'host' : master_host [ 0 ], 'port' : master_host [ 1 ] }
122123 pool = self .get_pool (max_connections = 1 , timeout = 0.1 ,
123124 connection_kwargs = connection_kwargs )
124125 pool .get_connection ('_' )
@@ -134,7 +135,7 @@ def test_connection_pool_blocks_until_conn_available(self, master_host):
134135 When out of connections, block until another connection is released
135136 to the pool
136137 """
137- connection_kwargs = {'host' : master_host }
138+ connection_kwargs = {'host' : master_host [ 0 ], 'port' : master_host [ 1 ] }
138139 pool = self .get_pool (max_connections = 1 , timeout = 2 ,
139140 connection_kwargs = connection_kwargs )
140141 c1 = pool .get_connection ('_' )
@@ -149,7 +150,7 @@ def target():
149150 assert time .time () - start >= 0.1
150151
151152 def test_reuse_previously_released_connection (self , master_host ):
152- connection_kwargs = {'host' : master_host }
153+ connection_kwargs = {'host' : master_host [ 0 ], 'port' : master_host [ 1 ] }
153154 pool = self .get_pool (connection_kwargs = connection_kwargs )
154155 c1 = pool .get_connection ('_' )
155156 pool .release (c1 )
0 commit comments