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