我想在每个测试方法的docstring中存储提示,这样testloader就可以根据这些提示包含或排除测试。像这样:
def test_login_with_valid_credentials(self):
'''#functional #security #nondestructive'''
# code goes here
然后,testloader将发现包含子字符串“#functional”或其他任何内容的所有测试。在
我尽量避免为此使用decorator,因为我认为使用docstring会更灵活。(也许我错了。)
作为新来的鼻子,我将感谢任何帮助。谢谢!在
这个
@attr
鼻子装饰器不就是为了这个吗?https://nose.readthedocs.org/en/latest/plugins/attrib.html然后可以选择一个或多个值来运行:
^{pr2}$如果有人想知道,这是实际的语法:
因此,测试会被调用:
^{pr2}$相关问题 更多 >
编程相关推荐