本文整理汇总了Python中numpy.testing.dec.setastest方法的典型用法代码示例。如果您正苦于以下问题:Python dec.setastest方法的具体用法?Python dec.setastest怎么用?Python dec.setastest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类numpy.testing.dec
的用法示例。
在下文中一共展示了dec.setastest方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setastest
# 需要导入模块: from numpy.testing import dec [as 别名]
# 或者: from numpy.testing.dec import setastest [as 别名]
def setastest(tf=True):
"""
Signals to nose that this function is or is not a test.
Parameters
----------
tf : bool
If True, specifies that the decorated callable is a test.
If False, specifies that the decorated callable is not a test.
Default is True.
Notes
-----
This decorator can't use the nose namespace, because it can be
called from a non-test module. See also ``istest`` and ``nottest`` in
``nose.tools``.
Examples
--------
`setastest` can be used in the following way::
from numpy.testing import dec
@dec.setastest(False)
def func_with_test_in_name(arg1, arg2):
pass
"""
def set_test(t):
t.__test__ = tf
return t
return set_test