numpy.testing.dec.slow

testing.dec.slow(t)[源代码]

将测试标记为“慢”。

慢测试的确切定义显然取决于主观和硬件,但一般来说,任何需要超过一秒或两秒的单个测试都应标记为慢测试(整个套件包含数千个测试,因此即使一秒钟也很重要)。

参数
t可赎回的

测试结果显示速度很慢。

返回
t可赎回的

装饰测试 t .

实例

这个 numpy.testing 模块包括 import decorators as dec . 测试可以这样缓慢地进行:

from numpy.testing import *

@dec.slow
def test_big(self):
    print('Big, slow test')