Skip to content
Open
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: 1 addition & 1 deletion launch/launch/actions/timer_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def __init__(
'passing a string literal was deprecated',
stacklevel=2)
self.__period = type_utils.normalize_typed_substitution(period, float)
self.__actions = actions
self.__actions = list(actions)
self.__context_locals: Dict[Text, Any] = {}
self.__canceled = False

Expand Down
9 changes: 9 additions & 0 deletions launch/test/launch/test_timer_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@
from launch.substitutions import PythonExpression


def test_timer_action_materializes_action_iterables():
action = LogInfo(msg='timer action')
timer = TimerAction(period=1.0, actions=iter([action]))

described_actions = timer.describe_conditional_sub_entities()[0][1]
assert list(described_actions) == [action]
assert list(timer.actions) == [action]


def test_timer_action_can_capture_the_environment():
"""Test that timer actions capture the environment variables present when executed."""
# Regression test for https://github.com/ros2/launch_ros/issues/376
Expand Down