我有一个 TestMain.py 初始化并运行鼻子测试,我正在尝试在其中启用代码覆盖率。测试当前加载如下:
if __name__ == '__main__':
# Some initialization code here, so command-line cannot be used
# Coverage configuration here
test_loader = nose.loader.TestLoader(workingDir = './tests')
nose.core.TestProgram(testLoader = test_loader)
我发现的关于该插件的唯一“文档”是这个,而且很糟糕:https ://nose.readthedocs.org/en/latest/plugins/cover.html 。根本没有关于方法期望什么,必须以什么顺序调用它们的提示,并且源代码没有用(我应该提供一个解析器,什么是解析器?)
我需要配置选项(封面包和封面擦除)并启用 html 报告。
有人可以向我指出有关此 API 的综合文档或演示如何使用此插件吗?
谢谢!