rostest can load tests from a dotted name#722
rostest can load tests from a dotted name#722heuristicus wants to merge 1 commit intoros:indigo-develfrom
Conversation
|
Can you please add a unit test for the new feature to this PR. |
|
I've added some tests, but couldn't really come up with a way of programmatically ensuring that the expected tests are actually loaded. I'm just assuming that |
mirrors changes in ros/ros_comm#722
5bb7578 to
6bdba57
Compare
|
Had a chat about this - test should probably be testing the function itself (nosetest?) rather than running a rostest and crashing rostest itself. |
6bdba57 to
930a4a8
Compare
|
I've moved the tests to using the python Also squashed to a single commit. |
61ed672 to
0b693b4
Compare
|
@ros-pull-request-builder test this please |
|
@ros-pull-request-builder retest this please |
|
Thank you for the improvement. Jenkins is actually fine: http://build.ros.org/view/Jpr/job/Jpr__ros_comm__ubuntu_trusty_amd64/50/ I have cherry-picked the patch with the same modifications as ros/ros#104: 4c837a7 |
|
Several callers pass types instead of instances of |
This is a simple solution to the issue, using
unittest.TestLoader().loadTestsFromName. The dual-use (strorunittest.TestCase) of thetestparameter could be changed to use a kwarg instead. That would necessitatetestbeing an optional parameter which specifies theunittest.TestCaseclass, and some other parameter (test_from_nameor something?) specifying a string from which tests should be loaded. That would probably require additional checks to ensure that at least one of the optional parameters existed.You can check that the name-based loading works by changing line 56 in
test_rosbagtoHere's a test you can run to check that suite loading works correctly. You can run it with
rosrun test_rosbag tmp.py. Don't forget tochmod +x.ros_comm/test/test_rosbag/test/tmp.py:Fixes #423.