我正在编写一个Pythonic工具,用于验证某个系统的正确性。每个验证都是用Python的unittest
编写的,并且报告看起来像这样:
test_exclude_list_not_empty (__main__.TestRepoLists)
Assert the the exclude list is not empty ... ok
test_include_list_not_empty (__main__.TestRepoLists)
Assert the the include list is not empty ... ok
test_repo_list_not_empty (__main__.TestRepoLists)
Assert the the repo list is not empty ... ok
在我看来,这种格式很难阅读,特别是对于不熟悉Python的人而言。是否有任何报告生成器可以以漂亮的表格形式生成报告,例如:
+----------------------------------------------------------------+-----------+
| Test | Status |
+----------------------------------------------------------------+-----------+
| Assert the the exclude list is not empty | OK |
| Assert the the include list is not empty | OK |
| Assert the the repo list is not empty | OK |
| All the items in the include list should be in the repo list | OK |
+----------------------------------------------------------------+-----------+
澄清 测试套件在远程终端上运行,因此我更喜欢使用命令行报告工具。