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
2 changes: 2 additions & 0 deletions test_cli_remapping/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
<test_depend>launch</test_depend>
<test_depend>launch_testing</test_depend>
<test_depend>launch_testing_ament_cmake</test_depend>
<test_depend>launch_testing_ros</test_depend>
<test_depend>rmw_test_fixture_implementation</test_depend>
<test_depend>rclcpp</test_depend>
<test_depend>rclpy</test_depend>
<test_depend>test_msgs</test_depend>
Expand Down
7 changes: 4 additions & 3 deletions test_cli_remapping/test/test_cli_remapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from launch.actions import ExecuteProcess
import launch_testing
import launch_testing.actions
from launch_testing_ros.actions import EnableRmwIsolation

import rclpy

Expand Down Expand Up @@ -68,12 +69,11 @@ def get_environment_variable(name):
def generate_test_description(executable):
command = [executable]
# Execute python files using same python used to start this test
env = dict(os.environ)
if command[0][-3:] == '.py':
command.insert(0, sys.executable)
env['PYTHONUNBUFFERED'] = '1'

launch_description = LaunchDescription()
launch_description.add_action(EnableRmwIsolation())

test_context = {}
for replacement_name, (replacement_value, cli_argument) in TEST_CASES.items():
Expand All @@ -82,7 +82,8 @@ def generate_test_description(executable):
launch_description.add_action(
ExecuteProcess(
cmd=command + ['--ros-args', '--remap', cli_argument.format(**locals())],
name='name_maker_' + replacement_name, env=env
name='name_maker_' + replacement_name,
additional_env={'PYTHONUNBUFFERED': '1'},
)
)
test_context[replacement_name] = replacement_value.format(random_string=random_string)
Expand Down