numpy.testing.rundocs

testing.rundocs(filename=None, raise_on_error=True)[源代码]

运行在给定文件中找到的doctests。

默认情况下 rundocs 失败时引发断言错误。

参数
filenameSTR

为其运行doctests的文件的路径。

raise_on_error布尔

当doctest失败时是否引发断言错误。默认值为true。

笔记

用户/开发人员可以通过添加 doctests 论据 test() 打电话。例如,为运行所有测试(包括doctest) numpy.lib

>>> np.lib.test(doctests=True)