本文整理汇总了Python中numpy.testing.dec.skipif方法的典型用法代码示例。如果您正苦于以下问题:Python dec.skipif方法的具体用法?Python dec.skipif怎么用?Python dec.skipif使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类numpy.testing.dec
的用法示例。
在下文中一共展示了dec.skipif方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mpmath_check
# 需要导入模块: from numpy.testing import dec [as 别名]
# 或者: from numpy.testing.dec import skipif [as 别名]
def mpmath_check(min_ver):
if mpmath is None:
return dec.skipif(True, "mpmath is not installed")
return dec.skipif(LooseVersion(mpmath.__version__) < LooseVersion(min_ver),
"mpmath version >= %s required" % min_ver)
#------------------------------------------------------------------------------
# expi
#------------------------------------------------------------------------------
示例2: nonfunctional_tooslow
# 需要导入模块: from numpy.testing import dec [as 别名]
# 或者: from numpy.testing.dec import skipif [as 别名]
def nonfunctional_tooslow(func):
return dec.skipif(True, " Test not yet functional (too slow), needs more work.")(func)
示例3: nonfunctional_tooslow
# 需要导入模块: from numpy.testing import dec [as 别名]
# 或者: from numpy.testing.dec import skipif [as 别名]
def nonfunctional_tooslow(func):
return dec.skipif(True, " Test not yet functional (too slow), needs more work.")(func)
# ------------------------------------------------------------------------------
# Tools for dealing with mpmath quirks
# ------------------------------------------------------------------------------
示例4: check_version
# 需要导入模块: from numpy.testing import dec [as 别名]
# 或者: from numpy.testing.dec import skipif [as 别名]
def check_version(module, min_ver):
if type(module) == MissingModule:
return dec.skipif(True, "{} is not installed".format(module.name))
return dec.skipif(LooseVersion(module.__version__) < LooseVersion(min_ver),
"{} version >= {} required".format(module.__name__, min_ver))
#------------------------------------------------------------------------------
# Metaclass for decorating test_* methods
#------------------------------------------------------------------------------