MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / register

Method register

lib/sqlalchemy/testing/config.py:365–381  ·  lib/sqlalchemy/testing/config.py::Config.register

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)

Source from the content-addressed store, hash-verified

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):

Callers 3

setup_configFunction · 0.45
pytest_configureFunction · 0.45

Calls 2

ConfigClass · 0.85
addMethod · 0.45

Tested by 1

pytest_configureFunction · 0.36