Esempio n. 1
0
    def setUp(self):
        staging_env()
        self.bind = eng = engines.testing_engine()

        def unimpl(*arg, **kw):
            raise NotImplementedError()
        eng.dialect.get_unique_constraints = unimpl
Esempio n. 2
0
    def setUp(self):
        staging_env()
        self.bind = eng = engines.testing_engine()

        def unimpl(*arg, **kw):
            raise NotImplementedError()
        eng.dialect.get_unique_constraints = unimpl
Esempio n. 3
0
def setup_config(db_url, db_opts, options, file_config, follower_ident):
    if follower_ident:
        db_url = _follower_url_from_main(db_url, follower_ident)
    eng = engines.testing_engine(db_url, db_opts)
    eng.connect().close()
    cfg = config.Config.register(eng, db_opts, options, file_config)
    if follower_ident:
        _configure_follower(cfg, follower_ident)
    return cfg
Esempio n. 4
0
def setup_config(db_url, db_opts, options, file_config, follower_ident):
    if follower_ident:
        db_url = _follower_url_from_main(db_url, follower_ident)
    eng = engines.testing_engine(db_url, db_opts)
    eng.connect().close()
    cfg = config.Config.register(eng, db_opts, options, file_config)
    if follower_ident:
        _configure_follower(cfg, follower_ident)
    return cfg
Esempio n. 5
0
def _setup_engine(cls):
    if getattr(cls, '__engine_options__', None):
        eng = engines.testing_engine(options=cls.__engine_options__)
        config._current.push_engine(eng)
Esempio n. 6
0
 def setUp(self):
     self.bind = engines.testing_engine()
     self.bind.dialect.max_identifier_length = 30
Esempio n. 7
0
def _setup_engine(cls):
    if getattr(cls, "__engine_options__", None):
        eng = engines.testing_engine(options=cls.__engine_options__)
        config._current.push_engine(eng)
Esempio n. 8
0
"""Drop Oracle databases that are left over from a
multiprocessing test run.

Currently the cx_Oracle driver seems to sometimes not release a
TCP connection even if close() is called, which prevents the provisioning
system from dropping a database in-process.

"""
from alembic.testing.plugin import plugin_base
from alembic.testing import engines
from alembic.testing import provision
import logging
import sys

logging.basicConfig()
logging.getLogger(provision.__name__).setLevel(logging.INFO)

plugin_base.read_config()
oracle = plugin_base.file_config.get('db', 'oracle')

engine = engines.testing_engine(oracle, {})
provision.reap_oracle_dbs(engine, sys.argv[1])


Esempio n. 9
0
 def setUp(self):
     self.bind = engines.testing_engine()
     self.bind.dialect.max_identifier_length = 30