MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / _init_default_cluster

Function _init_default_cluster

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

Source from the content-addressed store, hash-verified

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