Hello!
I am seeking a recommendation for the following situation. I have a ROS2 package (humble) that only contains some python code, see it here.
I would like to add tests to it.
Build type: ament_cmake
Build Tool Dependencies:
ament_cmake
ament_cmake_python
Yes, I know the ament_cmake_python docs say to not to do this, however it’s an upsteam package, that’s just the convention of the package. There is no information the ament_cmake_python docs on how to add tests for python code.
According to the colcon docs, I need to put my tests folder matching the format of tests/test_FOO.py, so I did that.
Next, I inferred I need to declare a dependency on pytest like so:
<test_depend>pytest</test_depend>
When I run “colcon test --packages-select my_package”, the python tests are not recognized or run.
Is it required in the build situation to also utilize the ament_cmake_pytest package?
If so, this seems like a big disadvantage, and the tutorial about automatically finding the python tests don’t work in this build type.
Can I get a recommendation on how I should proceed?