add a config as one of the global configs. If there are no configs set up yet, this config also gets set as the "_current".
(cls, db, db_opts, options, file_config)
| 363 | |
| 364 | @classmethod |
| 365 | def register(cls, db, db_opts, options, file_config): |
| 366 | class="st">"""add a config as one of the global configs. |
| 367 | |
| 368 | If there are no configs set up yet, this config also |
| 369 | gets set as the class="st">"_current". |
| 370 | class="st">""" |
| 371 | global any_async |
| 372 | |
| 373 | cfg = Config(db, db_opts, options, file_config) |
| 374 | |
| 375 | class="cm"># if any backends include an async driver, then ensure |
| 376 | class="cm"># all setup/teardown and tests are wrapped in the maybe_async() |
| 377 | class="cm"># decorator that will set up a greenlet context for async drivers. |
| 378 | any_async = any_async or cfg.is_async |
| 379 | |
| 380 | cls._configs.add(cfg) |
| 381 | return cfg |
| 382 | |
| 383 | @classmethod |
| 384 | def set_as_current(cls, config, namespace): |