Code coverage with pytest-based ROS tests
Hi,
I'm trying to add code coverage to my pytests, following the instructions from code_coverage repo, except that I use python3-coverage.
I run my rostest with pytest using the Pytest integration instructions
So I run both prefixed with python3-coverage run -p. The rostest file looks like:
<launch>
<node name="config_server" pkg="config_server" type="config_server_node.py"
launch-prefix="python3-coverage run -p">
</node>
<param name="test_module" value="test_config_server.py"/>
<test test-name="config_server_test" pkg="config_server" type="pytest_runner.py" time-limit="60.0"
launch-prefix="python3-coverage run -p"/>
</launch>
As explained in the issue I opened on code coverage repo, I'm actually getting a coverage report on screen, but all files are empty!
nodes/config_server_node.py 7 0 100%
src/config_server/config_server.py 138 8 94%
(see the whole command line output on the issue for details)
Has anyone tried this before and has an example of how to do?
Thanks a lot