(initdb_options=None)
| 240 | |
| 241 | |
| 242 | def _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 | |
| 262 | def _shutdown_cluster(cluster): |
no test coverage detected
searching dependent graphs…