Change pytest testsuite name in xml report

4.5k Views Asked by At

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

There are 1 best solutions below

3
On BEST ANSWER

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