Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change pytest testsuite name in xml report

Tags:

pytest

xunit

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"

like image 756
Andrey Avatar asked Dec 26 '16 09:12

Andrey


1 Answers

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
like image 76
nicbou Avatar answered Nov 09 '22 03:11

nicbou