From d2358629c9ea7f12718f32b64c7de7f2030dcd32 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 26 Jul 2014 20:50:57 -0400 Subject: - scale up for mysql, sqlite --- lib/sqlalchemy/testing/plugin/plugin_base.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'lib/sqlalchemy/testing/plugin/plugin_base.py') diff --git a/lib/sqlalchemy/testing/plugin/plugin_base.py b/lib/sqlalchemy/testing/plugin/plugin_base.py index f16a0828f..095e3f369 100644 --- a/lib/sqlalchemy/testing/plugin/plugin_base.py +++ b/lib/sqlalchemy/testing/plugin/plugin_base.py @@ -103,7 +103,7 @@ def setup_options(make_option): def configure_follower(follower_ident): global FOLLOWER_IDENT - FOLLOWER_IDENT = "test_%s" % follower_ident + FOLLOWER_IDENT = follower_ident def read_config(): @@ -221,18 +221,20 @@ def _engine_uri(options, file_config): if not db_urls: db_urls.append(file_config.get('db', 'default')) + from . import provision + for db_url in db_urls: - if FOLLOWER_IDENT: - from sqlalchemy.engine import url - db_url = url.make_url(db_url) - db_url.database = FOLLOWER_IDENT - eng = engines.testing_engine(db_url, db_opts) - eng.connect().close() - config.Config.register(eng, db_opts, options, file_config, testing) + cfg = provision.setup_config( + db_url, db_opts, options, file_config, FOLLOWER_IDENT) + + if not config._current: + cfg.set_as_current(cfg, testing) config.db_opts = db_opts + + @post def _engine_pool(options, file_config): if options.mockpool: -- cgit v1.2.1