MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / create_pool

Method create_pool

test/asynchronous/test_pooling.py:165–175  ·  view source on GitHub ↗
(self, pair=None, *args, **kwargs)

Source from the content-addressed store, hash-verified

163 await db.test.insert_many([{} for _ in range(10)])
164
165 async def create_pool(self, pair=None, *args, **kwargs):
166 if pair is None:
167 pair = (await async_client_context.host, await async_client_context.port)
168 # Start the pool with the correct ssl options.
169 pool_options = async_client_context.client._topology_settings.pool_options
170 kwargs["ssl_context"] = pool_options._ssl_context
171 kwargs["tls_allow_invalid_hostnames"] = pool_options.tls_allow_invalid_hostnames
172 kwargs["server_api"] = pool_options.server_api
173 pool = Pool(pair, PoolOptions(*args, **kwargs))
174 await pool.ready()
175 return pool
176
177
178class TestPooling(_TestPoolingBase):

Calls 3

readyMethod · 0.95
PoolClass · 0.90
PoolOptionsClass · 0.90

Tested by

no test coverage detected