Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ros2cli/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<exec_depend>rclpy</exec_depend>
<exec_depend>fzf</exec_depend>

<test_depend>rmw_test_fixture_implementation</test_depend>
<test_depend>ament_copyright</test_depend>
<test_depend>ament_flake8</test_depend>
<test_depend>ament_pep257</test_depend>
Expand Down
17 changes: 17 additions & 0 deletions ros2cli/test/test_ros2cli_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
from ros2cli.node.daemon import shutdown_daemon
from ros2cli.node.daemon import spawn_daemon

try:
from rmw_test_fixture_implementation import rmw_test_isolation_start
from rmw_test_fixture_implementation import rmw_test_isolation_stop
_HAS_RMW_ISOLATION = True
except ImportError:
_HAS_RMW_ISOLATION = False

import test_msgs.action
import test_msgs.msg
import test_msgs.srv
Expand Down Expand Up @@ -56,6 +63,16 @@
TEST_ACTION_TYPE = 'test_msgs/action/Fibonacci'


@pytest.fixture(autouse=True, scope='session')
def rmw_isolation():
"""Start RMW isolation before spawning the daemon."""
if _HAS_RMW_ISOLATION:
rmw_test_isolation_start()
yield
if _HAS_RMW_ISOLATION:
rmw_test_isolation_stop()


@pytest.fixture(autouse=True, scope='module')
def local_node():
with rclpy.init():
Expand Down