Change pytest testsuite name in xml report

ぃ、小莉子 提交于 2019-12-06 08:52:49

问题


Because we started same tests with different interface, then take all reports and send them to jenkins. It's difficult to recognise with what interface we have errors. Before we use nose, it has parameter "--xunit-testsuite-name", has pytest analog? I want to change name of test suite in reports

testsuite errors="0" failures="0" name="pytest" skips="0" tests="12" time="103.702"

to

testsuite errors="0" failures="0" name="inteface1" skips="0" tests="12" time="103.702"


回答1:


You can add a junit_suite_name attribute to your Pytest config file since pytest 3.1:

[pytest]
junit_suite_name = my_suite

This can also be set in the command line:

pytest ... -o junit_suite_name=my_suite


来源:https://stackoverflow.com/questions/41328882/change-pytest-testsuite-name-in-xml-report

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!