numpy.testing.rundocs#

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

运行给定文件中找到的 doctest.

默认情况下, rundocs 在失败时引发 AssertionError.

参数:
filenamestr

要为其运行 doctest 的文件的路径.

raise_on_errorbool

当 doctest 失败时是否引发 AssertionError.默认为 True.

注释

用户/开发者可以通过将 doctests 参数添加到 test() 调用来运行 doctest.例如,要运行 numpy.lib 的所有测试(包括 doctest):

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