summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/config.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-07-26 20:50:57 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-07-26 20:50:57 -0400
commitd2358629c9ea7f12718f32b64c7de7f2030dcd32 (patch)
tree1933ad41f00c94c00b9590e72f275e94e04f69ce /lib/sqlalchemy/testing/config.py
parente65cb04974cc35e6f8301b9b7bc2a02d11edf139 (diff)
downloadsqlalchemy-d2358629c9ea7f12718f32b64c7de7f2030dcd32.tar.gz
- scale up for mysql, sqlite
Diffstat (limited to 'lib/sqlalchemy/testing/config.py')
-rw-r--r--lib/sqlalchemy/testing/config.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/sqlalchemy/testing/config.py b/lib/sqlalchemy/testing/config.py
index 84344eb31..b24483bb7 100644
--- a/lib/sqlalchemy/testing/config.py
+++ b/lib/sqlalchemy/testing/config.py
@@ -12,7 +12,8 @@ db = None
db_url = None
db_opts = None
file_config = None
-
+test_schema = None
+test_schema_2 = None
_current = None
@@ -22,12 +23,14 @@ class Config(object):
self.db_opts = db_opts
self.options = options
self.file_config = file_config
+ self.test_schema = "test_schema"
+ self.test_schema_2 = "test_schema_2"
_stack = collections.deque()
_configs = {}
@classmethod
- def register(cls, db, db_opts, options, file_config, namespace):
+ def register(cls, db, db_opts, options, file_config):
"""add a config as one of the global configs.
If there are no configs set up yet, this config also
@@ -35,18 +38,18 @@ class Config(object):
"""
cfg = Config(db, db_opts, options, file_config)
- global _current
- if not _current:
- cls.set_as_current(cfg, namespace)
cls._configs[cfg.db.name] = cfg
cls._configs[(cfg.db.name, cfg.db.dialect)] = cfg
cls._configs[cfg.db] = cfg
+ return cfg
@classmethod
def set_as_current(cls, config, namespace):
- global db, _current, db_url
+ global db, _current, db_url, test_schema, test_schema_2
_current = config
db_url = config.db.url
+ test_schema = config.test_schema
+ test_schema_2 = config.test_schema_2
namespace.db = db = config.db
@classmethod