[ros-users] [Discourse.ros.org] [Quality Assurance] Pytest support for ROS / rostest

Alexander Rössler ros.discourse at gmail.com
Sat Jun 2 14:48:59 UTC 2018

Hello everyone,

I want to stir some interest in supporting pytest for ROS. [pytest](https://docs.pytest.org/en/latest/) 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.](https://machinekoder.com/testing-ros-powered-robots-pytest/)

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](https://github.com/machinekoder/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.


[Visit Topic](https://discourse.ros.org/t/pytest-support-for-ros-rostest/4990/1) or reply to this email to respond.

More information about the ros-users mailing list