本文簡要介紹 python 語言中 numpy.testing.run_module_suite
的用法。
用法:
testing.run_module_suite(file_to_run=None, argv=None)
運行測試模塊。
相當於從命令行調用
$ nosetests <argv> <file_to_run>
- file_to_run: str,可選
測試模塊的路徑,或無。默認情況下,運行調用此函數的模塊。
- argv: 字符串列表
要傳遞給鼻子測試運行者的參數。
argv[0]
被忽略。nosetests
接受的所有命令行參數都將起作用。如果是默認值 None,則使用sys.argv。
參數:
例子:
添加以下內容:
if __name__ == "__main__" : run_module_suite(argv=sys.argv)
在測試模塊結束時,將在 python 解釋器中調用該模塊時運行測試。
或者,調用:
>>> run_module_suite(file_to_run="numpy/tests/test_matlib.py")
從解釋器將運行“test_matlib.py”中的所有測試例程。
相關用法
- Python numpy testing.rundocs用法及代碼示例
- Python numpy testing.assert_warns用法及代碼示例
- Python numpy testing.assert_array_almost_equal_nulp用法及代碼示例
- Python numpy testing.assert_array_less用法及代碼示例
- Python numpy testing.assert_raises用法及代碼示例
- Python numpy testing.assert_almost_equal用法及代碼示例
- Python numpy testing.assert_approx_equal用法及代碼示例
- Python numpy testing.assert_allclose用法及代碼示例
- Python numpy testing.decorators.slow用法及代碼示例
- Python numpy testing.suppress_warnings用法及代碼示例
- Python numpy testing.assert_string_equal用法及代碼示例
- Python numpy testing.assert_array_max_ulp用法及代碼示例
- Python numpy testing.assert_equal用法及代碼示例
- Python numpy testing.assert_array_equal用法及代碼示例
- Python numpy testing.assert_array_almost_equal用法及代碼示例
- Python numpy testing.decorators.setastest用法及代碼示例
- Python numpy tensordot用法及代碼示例
- Python numpy trim_zeros用法及代碼示例
- Python numpy trace用法及代碼示例
- Python numpy tri用法及代碼示例
- Python numpy true_divide用法及代碼示例
- Python numpy transpose用法及代碼示例
- Python numpy tile用法及代碼示例
- Python numpy tanh用法及代碼示例
- Python numpy trapz用法及代碼示例
注:本文由純淨天空篩選整理自numpy.org大神的英文原創作品 numpy.testing.run_module_suite。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。