(self)
| 201 | self.assertEqual(1, len(cx_pool.conns)) |
| 202 | |
| 203 | def test_get_socket_and_exception(self): |
| 204 | # get_socket() returns socket after a non-network error. |
| 205 | cx_pool = self.create_pool(max_pool_size=1, wait_queue_timeout=1) |
| 206 | with self.assertRaises(ZeroDivisionError): |
| 207 | with cx_pool.checkout() as conn: |
| 208 | 1 / 0 |
| 209 | |
| 210 | # Socket was returned, not closed. |
| 211 | with cx_pool.checkout() as new_connection: |
| 212 | self.assertEqual(conn, new_connection) |
| 213 | |
| 214 | self.assertEqual(1, len(cx_pool.conns)) |
| 215 | |
| 216 | def test_pool_removes_closed_socket(self): |
| 217 | # Test that Pool removes explicitly closed socket. |
nothing calls this directly
no test coverage detected