Search code examples
pythonpython-3.xpytestpython-unittestpytest-html

Is there any way to generate one HTML report from two pytest runs?


my runtests.sh file contains the below scripts

  • pytest -v -s <file_name_1> --html=report1.html
  • pytest -v -s <file_name_2> --html=report2.html

I'm trying to obtain a single report file which should contain the execution report of both file_1 & file 2.


Solution

  • Your best option is to run both files in the same run command, (as shown below), which will combine all results into the same report.

    pytest -v -s file_1.py file_2.py --html=report.html