在鼻子中以编程方式列出测试名称

时间:2016-05-13 16:37:32

标签: nose

我想做相同的事情:

nosetests -v --collect-only <path_to_test_file>

在Python脚本中,即生成测试名称列表,而不生成任何测试。

有一种简单的方法吗?

1 个答案:

答案 0 :(得分:1)

获得它的一种快捷方法:在python中运行此命令,但使用import string s = 'Was it a cat I saw?' s = s.translate(None, string.punctuation + ' ').lower() print(s) # wasitacatisaw 将测试结果输出到xml并读取xml文件以获取测试列表。或者制作一个快速插件来嗅探测试。

相关问题