當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。