当前位置: 首页>>代码示例>>Python>>正文


Python config.file_config方法代码示例

本文整理汇总了Python中sqlalchemy.testing.config.file_config方法的典型用法代码示例。如果您正苦于以下问题:Python config.file_config方法的具体用法?Python config.file_config怎么用?Python config.file_config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sqlalchemy.testing.config的用法示例。


在下文中一共展示了config.file_config方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: post_begin

# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import file_config [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() 
开发者ID:jpush,项目名称:jbox,代码行数:19,代码来源:plugin_base.py

示例2: post_begin

# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import file_config [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() 
开发者ID:sqlalchemy,项目名称:sqlalchemy,代码行数:18,代码来源:plugin_base.py

示例3: read_config

# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import file_config [as 别名]
def read_config():
    global file_config
    file_config = configparser.ConfigParser()
    file_config.read(['setup.cfg', 'test.cfg']) 
开发者ID:jpush,项目名称:jbox,代码行数:6,代码来源:plugin_base.py

示例4: pre_begin

# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import file_config [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) 
开发者ID:jpush,项目名称:jbox,代码行数:8,代码来源:plugin_base.py

示例5: _list_dbs

# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import file_config [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) 
开发者ID:jpush,项目名称:jbox,代码行数:7,代码来源:plugin_base.py

示例6: _setup_options

# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import file_config [as 别名]
def _setup_options(opt, file_config):
    global options
    options = opt 
开发者ID:jpush,项目名称:jbox,代码行数:5,代码来源:plugin_base.py

示例7: _init_skiptest

# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import file_config [as 别名]
def _init_skiptest(options, file_config):
    from sqlalchemy.testing import config

    config._skip_test_exception = _skip_test_exception 
开发者ID:jpush,项目名称:jbox,代码行数:6,代码来源:plugin_base.py

示例8: _engine_uri

# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import file_config [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) 
开发者ID:jpush,项目名称:jbox,代码行数:32,代码来源:plugin_base.py

示例9: _requirements

# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import file_config [as 别名]
def _requirements(options, file_config):

    requirement_cls = file_config.get('sqla_testing', "requirement_cls")
    _setup_requirements(requirement_cls) 
开发者ID:jpush,项目名称:jbox,代码行数:6,代码来源:plugin_base.py

示例10: _reverse_topological

# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import file_config [as 别名]
def _reverse_topological(options, file_config):
    if options.reversetop:
        from sqlalchemy.orm.util import randomize_unitofwork
        randomize_unitofwork() 
开发者ID:jpush,项目名称:jbox,代码行数:6,代码来源:plugin_base.py

示例11: _setup_profiling

# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import file_config [as 别名]
def _setup_profiling(options, file_config):
    from sqlalchemy.testing import profiling
    profiling._profile_stats = profiling.ProfileStatsFile(
        file_config.get('sqla_testing', 'profile_file')) 
开发者ID:jpush,项目名称:jbox,代码行数:6,代码来源:plugin_base.py

示例12: _monkeypatch_cdecimal

# 需要导入模块: from sqlalchemy.testing import config [as 别名]
# 或者: from sqlalchemy.testing.config import file_config [as 别名]
def _monkeypatch_cdecimal(options, file_config):
    if options.cdecimal:
        import cdecimal
        sys.modules['decimal'] = cdecimal 
开发者ID:yfauser,项目名称:planespotter,代码行数:6,代码来源:plugin_base.py


注:本文中的sqlalchemy.testing.config.file_config方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。