# Pytest support for ROS / rostest

**URL:** <https://discourse.openrobotics.org/t/pytest-support-for-ros-rostest/4990>\
**Category:** Quality Assurance\
**Created:** [June 2, 2018, 2:38pm UTC](https://discourse.openrobotics.org/t/pytest-support-for-ros-rostest/4990 "2018-06-02T14:38:46Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![dirk-thomas](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/dirk-thomas/32/4328_2.png) [@dirk-thomas](https://discourse.openrobotics.org/u/dirk-thomas)\
**Post date:** [June 26, 2018, 8:19pm UTC](https://discourse.openrobotics.org/t/pytest-support-for-ros-rostest/4990/6 "2018-06-26T20:19:54Z")

</div>

I concur that `pytest` feels “easier” / more natural to use (obviously a subjective point). It certainly is more actively being developed and offers more features through the numerous available plugins. For ROS 2 we are using `pytest` over `nose` for a while for these reasons.

The new build tool [colcon](http://colcon.readthedocs.io) also invokes Python tests with `pytest`. Since `pytest` is capable of running tests written for `nose` this is usually compatible with exiting tests.

There are three parts to Python unit testing to consider:

- the API used to write unit tests
- the tool used to perform the testing of a package
- the tool used by `rostest` internally

I think the three parts are fairly independent from each other. E.g. using `colcon` you can run the tests of a ROS package with `pytest` even though they use `nose` / `unittest` API.

---

_[View the full topic](https://discourse.openrobotics.org/t/pytest-support-for-ros-rostest/4990)._
