MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / register

Method register

lib/sqlalchemy/testing/config.py:362–378  ·  view source on GitHub ↗

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

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

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