MCPcopy Index your code
hub / github.com/MagicStack/asyncpg / _init_default_cluster

Function _init_default_cluster

asyncpg/_testbase/__init__.py:242–259  ·  view source on GitHub ↗
(initdb_options=None)

Source from the content-addressed store, hash-verified

240
241
242def _init_default_cluster(initdb_options=None):
243 global _default_cluster
244
245 if _default_cluster is None:
246 pg_host = os.environ.get('PGHOST')
247 if pg_host:
248 # Using existing cluster, assuming it is initialized and running
249 _default_cluster = pg_cluster.RunningCluster()
250 else:
251 _default_cluster = _init_cluster(
252 pg_cluster.TempCluster,
253 cluster_kwargs={
254 "data_dir_suffix": ".apgtest",
255 },
256 initdb_options=_get_initdb_options(initdb_options),
257 )
258
259 return _default_cluster
260
261
262def _shutdown_cluster(cluster):

Callers 1

setup_clusterMethod · 0.85

Calls 3

_init_clusterFunction · 0.85
_get_initdb_optionsFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…