我可以设置鼻子测试运行@attr标签。我现在想知道是否可以在测试名称的末尾添加@attr标记?我们要做的是添加一个标记如果我们的测试遇到问题,我们为它写了一个缺陷,然后我们将把缺陷编号作为@attr标记。然后,当我们运行时,我们就可以很容易地识别出哪些测试对它们有开放的缺陷。在
只是想知道这是否可能,以及去哪里看看如何设置它?在
编辑结果运行时回答:
试验结果:
所以我有点知道发生了什么,如果在类级别有@fancyattr()
,它会把它捡起来并更改类的名称。当我将@fancyattr()
放在测试级别时,它不会更改测试的名称,这正是我需要它做的。在
例如-更改类的名称:
@dms_attr('DMSTEST')
@attr('smoke_login', 'smoketest', priority=1)
class TestLogins(BaseSmoke):
"""
Just logs into the system and then logs off
"""
def setUp(self):
BaseSmoke.setUp(self)
def test_login(self):
print u"I can login -- taking a nap now"
sleep(5)
print u"Getting off now"
def tearDown(self):
BaseSmoke.tearDown(self)
这就是我需要的,但它不起作用:
^{pr2}$更新了我看到的__doc__
屏幕截图:
以下是如何使用args类型属性执行此操作:
重命名_测试.py公司名称:
运行试验:
^{pr2}$编辑:为了让xunit报告正常工作,应该在运行测试之前对测试进行重命名。您可以在import上完成,下面是未经测试的hack演示如何进行:
重命名_测试.py公司名称:
相关问题 更多 >
编程相关推荐