diff --git a/launch_testing_ros/launch_testing_ros_pytest_entrypoint.py b/launch_testing_ros/launch_testing_ros_pytest_entrypoint.py index ce360660..3fd473fd 100644 --- a/launch_testing_ros/launch_testing_ros_pytest_entrypoint.py +++ b/launch_testing_ros/launch_testing_ros_pytest_entrypoint.py @@ -17,6 +17,8 @@ # importing downstream modules in upstream packages when built with a merged # workspace. +import pathlib + import pytest @@ -31,7 +33,8 @@ def pytest_launch_collect_makemodule(module_path, parent, entrypoint): if marks and any(m.name == 'rostest' for m in marks): from launch_testing_ros.pytest.hooks import LaunchROSTestModule if _pytest_version_ge(7): - module = LaunchROSTestModule.from_parent(parent=parent, path=module_path) + path = pathlib.Path(module_path) + module = LaunchROSTestModule.from_parent(parent=parent, path=path) else: module = LaunchROSTestModule.from_parent(parent=parent, fspath=module_path) for mark in marks: diff --git a/launch_testing_ros/test/examples/check_msgs_launch_test.py b/launch_testing_ros/test/examples/check_msgs_launch_test.py index ce296442..20100012 100644 --- a/launch_testing_ros/test/examples/check_msgs_launch_test.py +++ b/launch_testing_ros/test/examples/check_msgs_launch_test.py @@ -55,11 +55,8 @@ def subscription_callback(self, data: String): self.msg_event_object.set() def spin(self): - try: - while rclpy.ok() and not self.spinning.is_set(): - rclpy.spin_once(self.node, timeout_sec=0.1) - finally: - return + while rclpy.ok() and not self.spinning.is_set(): + rclpy.spin_once(self.node, timeout_sec=0.1) def setUp(self): rclpy.init()