當前位置: 首頁>>代碼示例>>Python>>正文


Python config.skip_test方法代碼示例

本文整理匯總了Python中sqlalchemy.testing.config.skip_test方法的典型用法代碼示例。如果您正苦於以下問題:Python config.skip_test方法的具體用法?Python config.skip_test怎麽用?Python config.skip_test使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sqlalchemy.testing.config的用法示例。


在下文中一共展示了config.skip_test方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _do_skips

# 需要導入模塊: from sqlalchemy.testing import config [as 別名]
# 或者: from sqlalchemy.testing.config import skip_test [as 別名]
def _do_skips(cls):
    reasons = []
    all_configs = _possible_configs_for_cls(cls, reasons)

    if getattr(cls, "__skip_if__", False):
        for c in getattr(cls, "__skip_if__"):
            if c():
                config.skip_test(
                    "'%s' skipped by %s" % (cls.__name__, c.__name__)
                )

    if not all_configs:
        msg = "'%s' unsupported on any DB implementation %s%s" % (
            cls.__name__,
            ", ".join(
                "'%s(%s)+%s'"
                % (
                    config_obj.db.name,
                    ".".join(
                        str(dig)
                        for dig in exclusions._server_version(config_obj.db)
                    ),
                    config_obj.db.driver,
                )
                for config_obj in config.Config.all_configs()
            ),
            ", ".join(reasons),
        )
        config.skip_test(msg)
    elif hasattr(cls, "__prefer_backends__"):
        non_preferred = set()
        spec = exclusions.db_spec(*util.to_list(cls.__prefer_backends__))
        for config_obj in all_configs:
            if not spec(config_obj):
                non_preferred.add(config_obj)
        if all_configs.difference(non_preferred):
            all_configs.difference_update(non_preferred)

    if config._current not in all_configs:
        _setup_config(all_configs.pop(), cls) 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:42,代碼來源:plugin_base.py

示例2: _run_doctest

# 需要導入模塊: from sqlalchemy.testing import config [as 別名]
# 或者: from sqlalchemy.testing.config import skip_test [as 別名]
def _run_doctest(self, fname):
        here = os.path.dirname(__file__)
        sqla_base = os.path.normpath(os.path.join(here, "..", ".."))
        path = os.path.join(sqla_base, "doc/build", fname)
        if not os.path.exists(path):
            config.skip_test("Can't find documentation file %r" % path)
        with open(path) as file_:
            content = file_.read()
            content = re.sub(r"{(?:stop|sql|opensql)}", "", content)
            self._run_doctest_for_content(fname, content) 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:12,代碼來源:test_tutorials.py

示例3: _do_skips

# 需要導入模塊: from sqlalchemy.testing import config [as 別名]
# 或者: from sqlalchemy.testing.config import skip_test [as 別名]
def _do_skips(cls):
    reasons = []
    all_configs = _possible_configs_for_cls(cls, reasons)

    if getattr(cls, '__skip_if__', False):
        for c in getattr(cls, '__skip_if__'):
            if c():
                config.skip_test("'%s' skipped by %s" % (
                    cls.__name__, c.__name__)
                )

    if not all_configs:
        msg = "'%s' unsupported on any DB implementation %s%s" % (
            cls.__name__,
            ", ".join(
                "'%s(%s)+%s'" % (
                    config_obj.db.name,
                    ".".join(
                        str(dig) for dig in
                        exclusions._server_version(config_obj.db)),
                    config_obj.db.driver
                )
              for config_obj in config.Config.all_configs()
            ),
            ", ".join(reasons)
        )
        config.skip_test(msg)
    elif hasattr(cls, '__prefer_backends__'):
        non_preferred = set()
        spec = exclusions.db_spec(*util.to_list(cls.__prefer_backends__))
        for config_obj in all_configs:
            if not spec(config_obj):
                non_preferred.add(config_obj)
        if all_configs.difference(non_preferred):
            all_configs.difference_update(non_preferred)

    if config._current not in all_configs:
        _setup_config(all_configs.pop(), cls) 
開發者ID:bkerler,項目名稱:android_universal,代碼行數:40,代碼來源:plugin_base.py

示例4: _do_skips

# 需要導入模塊: from sqlalchemy.testing import config [as 別名]
# 或者: from sqlalchemy.testing.config import skip_test [as 別名]
def _do_skips(cls):
    reasons = []
    all_configs = _possible_configs_for_cls(cls, reasons)

    if getattr(cls, '__skip_if__', False):
        for c in getattr(cls, '__skip_if__'):
            if c():
                config.skip_test("'%s' skipped by %s" % (
                    cls.__name__, c.__name__)
                )

    if not all_configs:
        if getattr(cls, '__backend__', False):
            msg = "'%s' unsupported for implementation '%s'" % (
                cls.__name__, cls.__only_on__)
        else:
            msg = "'%s' unsupported on any DB implementation %s%s" % (
                cls.__name__,
                ", ".join(
                    "'%s(%s)+%s'" % (
                        config_obj.db.name,
                        ".".join(
                            str(dig) for dig in
                            config_obj.db.dialect.server_version_info),
                        config_obj.db.driver
                    )
                  for config_obj in config.Config.all_configs()
                ),
                ", ".join(reasons)
            )
        config.skip_test(msg)
    elif hasattr(cls, '__prefer_backends__'):
        non_preferred = set()
        spec = exclusions.db_spec(*util.to_list(cls.__prefer_backends__))
        for config_obj in all_configs:
            if not spec(config_obj):
                non_preferred.add(config_obj)
        if all_configs.difference(non_preferred):
            all_configs.difference_update(non_preferred)

    if config._current not in all_configs:
        _setup_config(all_configs.pop(), cls) 
開發者ID:jpush,項目名稱:jbox,代碼行數:44,代碼來源:plugin_base.py


注:本文中的sqlalchemy.testing.config.skip_test方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。