ros / urdf_parser_py

Standalone URDF parser for Python.
86 stars 48 forks source link

Make unit test run with `catkin_make run_tests` #15

Closed sloretz closed 7 years ago

sloretz commented 7 years ago

I notice the unit tests wasn't running when using catkin_make run_tests. I changed how the test was added to use the catkin cmake macros. I also added python-mock as a test dependency because the official ubuntu/trusty docker image does not have that installed by default.

clalancette commented 7 years ago

I love the change. However, it looks like all CI has failed, with no yaml. I think we'll need to add python-yaml to the package.xml as well.

clalancette commented 7 years ago

A couple of things:

sloretz commented 7 years ago

@clalancette Will do with the package.xml!

I learned from @dirk-thomas that unit tests can't expect to have the python path set up for importing python packages from the current package in all cases when using catkin_make. The unit test now adds ../src to sys.path. catkin_make_isolated and catkin build don't have this issue.

sloretz commented 7 years ago

@clalancette I updated the package.xml. An odd thing is it has a <depend>python</depend>. I'm 99% sure that is unnecessary.

clalancette commented 7 years ago

I agree with you that the on python is a bit weird. However, there are other packages (vision_opencv, for instance), which also have that dependency. I'll leave it up to you, but I'd just leave it in for now; it probably doesn't hurt anything. Otherwise, I think this looks good to me, so feel free to merge it.