其他测试框架 pytest-allure-adaptor 能不能通过数据驱动修改报告中 case 的属性?

dadeshuo · 2017年06月06日 · 787 次阅读

版本:
pytest (3.1.1)
pytest-allure-adaptor (1.7.7)

官方例子中添加属性全部是由装饰器实现的
google 了一大圈好像没看到动态插入 feature,story 等属性的方法啊

@allure.feature('Feature2')
@allure.story('Story2', 'Story3')
@allure.story('Story4')
 class TestBar:

    # will have 'Feature2 and Story2 and Story3 and Story4'
    def test_bar(self):
        pass

这种情况是不是只能通过类似 https://github.com/TesterlifeRaymond/doraemon 这样的方法,通过代码 + 数据去生成代码?
这样比纯依赖 pytest 的数据驱动模块更容易修改报告

另一个问题是 pytest-allure-adaptor 生成的 xml 报告 utf8 没有转义。。这是我哪里操作错了?还是说我应该去设置什么?

<ns0:test-suite xmlns:ns0="urn:model.allure.qatools.yandex.ru" start="1496734928773" stop="1496734928908">
  <name>main_test</name>
  <labels/>
  <test-cases>
    <test-case start="1496734928773" status="passed" stop="1496734928778">
      <name>Test_class.test_method[\u6a21\u57571:\u6d4b\u8bd5\u7528\u4f8b01]</name>
      <attachments>

暂无回复。
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册