I want to stir some interest in supporting pytest for ROS. pytest is a very popular unit testing framework for Python.
In my opinion, pytest is far easier to use than Python unittest and nosetests supported by ROS as of now. My personal experience says the easier something is to do, the likelier it is to be done. As we are talking about unit tests, an essential part of professional software development and QA, I think it’s even more important here. I have outline more about why this is necessary in a blog post.
The easiest way to support pytest within ROS is to use a new test runner that wraps pytest and extracts the JUnit XML output. Here is my attempt at doing that ros_pytest
ROS seems to pick up the test data very well. However, I noticed that failing tests still don’t trigger a failure when running rostests (but the log/terminal output shows the error). I would appreciate any input on why this is the case.
I joined the ROS community a few months ago and I want to make my first contribution to the project. So please let me know how if you think this is a good idea and how I can proceed.