Exibir resultados do teste unitário do python em formato tabular
Eu estou escrevendo uma ferramenta Pythonic que valida a correção de um certo sistema. Cada validação é escrita como um Pythonunittest
e o relatório se parece com:
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
Na minha opinião, este formato é difícil de ler, especialmente para não-Pythonists. Existe algum gerador de relatórios que pode gerar um relatório em um formato tabular agradável, por exemplo:
+----------------------------------------------------------------+-----------+
| 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 |
+----------------------------------------------------------------+-----------+
Esclarecimento O conjunto de testes é executado em um terminal remoto, então prefiro ferramentas de relatório de linha de comando.