In the project that I am currently working on, I have few of my colleagues who have written unit tests using unittest package and some using pytest package. When I run unit tests in CI pipeline, I invoke all of the unit tests. But, we now also need to get overall code coverage package. So, I have updated unit test invocation script by adding coverage (Please see script snippet below). But, I see that when I run below script I get coverage output of coverage run -a -m pytest -v -m unittests
(line 7 below) only not the tests run before. But, if I remove the line coverage run -a -m pytest -v -m unittests
(line 7 below), I get output of previous unit tests.
#!/bin/bash
set -xe
coverage run -m unittest test_a.py
coverage run -a -m unittest test_b.py
coverage run -a -m unittest test_c.py
...
cd process/tests/
coverage run -a -m pytest -v -m unittests
coverage report -m --omit=*/venv/*
coverage only reports the output of coverage run -a -m pytest -v -m unittests
ignoring the previously run unit tests.
Can I please know how can I get a single report for all unit tests in above scenario?