本文整理汇总了Python中sqlalchemy.testing.config.options方法的典型用法代码示例。如果您正苦于以下问题:Python config.options方法的具体用法?Python config.options怎么用?Python config.options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sqlalchemy.testing.config
的用法示例。
在下文中一共展示了config.options方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post_begin
# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import options [as 别名]
def post_begin():
"""things to set up later, once we know coverage is running."""
# Lazy setup of other options (post coverage)
for fn in post_configure:
fn(options, file_config)
# late imports, has to happen after config as well
# as nose plugins like coverage
global util, fixtures, engines, exclusions, \
assertions, warnings, profiling,\
config, testing
from sqlalchemy import testing # noqa
from sqlalchemy.testing import fixtures, engines, exclusions # noqa
from sqlalchemy.testing import assertions, warnings, profiling # noqa
from sqlalchemy.testing import config # noqa
from sqlalchemy import util # noqa
warnings.setup_filters()
示例2: post_begin
# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import options [as 别名]
def post_begin():
"""things to set up later, once we know coverage is running."""
# Lazy setup of other options (post coverage)
for fn in post_configure:
fn(options, file_config)
# late imports, has to happen after config.
global util, fixtures, engines, exclusions, assertions
global warnings, profiling, config, testing
from sqlalchemy import testing # noqa
from sqlalchemy.testing import fixtures, engines, exclusions # noqa
from sqlalchemy.testing import assertions, warnings, profiling # noqa
from sqlalchemy.testing import config # noqa
from sqlalchemy import util # noqa
warnings.setup_filters()
示例3: pre_begin
# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import options [as 别名]
def pre_begin(opt):
"""things to set up early, before coverage might be setup."""
global options
options = opt
for fn in pre_configure:
fn(options, file_config)
示例4: set_coverage_flag
# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import options [as 别名]
def set_coverage_flag(value):
options.has_coverage = value
示例5: _list_dbs
# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import options [as 别名]
def _list_dbs(*args):
print("Available --db options (use --dburi to override)")
for macro in sorted(file_config.options('db')):
print("%20s\t%s" % (macro, file_config.get('db', macro)))
sys.exit(0)
示例6: _setup_options
# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import options [as 别名]
def _setup_options(opt, file_config):
global options
options = opt
示例7: _init_skiptest
# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import options [as 别名]
def _init_skiptest(options, file_config):
from sqlalchemy.testing import config
config._skip_test_exception = _skip_test_exception
示例8: _engine_uri
# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import options [as 别名]
def _engine_uri(options, file_config):
from sqlalchemy.testing import config
from sqlalchemy import testing
from sqlalchemy.testing import provision
if options.dburi:
db_urls = list(options.dburi)
else:
db_urls = []
if options.db:
for db_token in options.db:
for db in re.split(r'[,\s]+', db_token):
if db not in file_config.options('db'):
raise RuntimeError(
"Unknown URI specifier '%s'. "
"Specify --dbs for known uris."
% db)
else:
db_urls.append(file_config.get('db', db))
if not db_urls:
db_urls.append(file_config.get('db', 'default'))
for db_url in db_urls:
cfg = provision.setup_config(
db_url, options, file_config, provision.FOLLOWER_IDENT)
if not config._current:
cfg.set_as_current(cfg, testing)
示例9: _requirements
# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import options [as 别名]
def _requirements(options, file_config):
requirement_cls = file_config.get('sqla_testing', "requirement_cls")
_setup_requirements(requirement_cls)
示例10: _reverse_topological
# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import options [as 别名]
def _reverse_topological(options, file_config):
if options.reversetop:
from sqlalchemy.orm.util import randomize_unitofwork
randomize_unitofwork()
示例11: _setup_profiling
# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import options [as 别名]
def _setup_profiling(options, file_config):
from sqlalchemy.testing import profiling
profiling._profile_stats = profiling.ProfileStatsFile(
file_config.get('sqla_testing', 'profile_file'))
示例12: want_class
# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import options [as 别名]
def want_class(cls):
if not issubclass(cls, fixtures.TestBase):
return False
elif cls.__name__.startswith('_'):
return False
elif config.options.backend_only and not getattr(cls, '__backend__',
False):
return False
else:
return True
示例13: stop_test_class
# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import options [as 别名]
def stop_test_class(cls):
#from sqlalchemy import inspect
#assert not inspect(testing.db).get_table_names()
engines.testing_reaper._stop_test_ctx()
try:
if not options.low_connections:
assertions.global_cleanup_assertions()
finally:
_restore_engine()
示例14: _setup_engine
# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import options [as 别名]
def _setup_engine(cls):
if getattr(cls, '__engine_options__', None):
eng = engines.testing_engine(options=cls.__engine_options__)
config._current.push_engine(eng, testing)
示例15: stop_test_class
# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import options [as 别名]
def stop_test_class(cls):
#from sqlalchemy import inspect
#assert not inspect(testing.db).get_table_names()
engines.testing_reaper._stop_test_ctx()
if not options.low_connections:
assertions.global_cleanup_assertions()
_restore_engine()