(initdb_options=None)
| 241 | |
| 242 | |
| 243 | def _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 | |
| 263 | def _shutdown_cluster(cluster): |
no test coverage detected