本文整理匯總了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
#------------------------------------------------------------------------------