Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove uses of deprecated ready_fn. #419

Merged
merged 1 commit into from
May 11, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import launch.substitutions

import launch_testing
import launch_testing.actions
import launch_testing.util

import pytest
Expand All @@ -44,7 +45,7 @@


@pytest.mark.launch_test
def generate_test_description(ready_fn):
def generate_test_description():

return launch.LaunchDescription([

Expand All @@ -63,7 +64,7 @@ def generate_test_description(ready_fn):
# provides a simple launch action that does this:
launch_testing.util.KeepAliveProc(),

launch.actions.OpaqueFunction(function=lambda context: ready_fn())
launch_testing.actions.ReadyToTest()
])


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import launch.actions

import launch_testing
import launch_testing.actions
from launch_testing.asserts import assertSequentialStdout

import pytest
Expand All @@ -45,14 +46,14 @@ def get_test_process_action():
# adding them to the test context, it's not necessary to scope them at the module level like in
# the good_proc.test.py example
@pytest.mark.launch_test
def generate_test_description(ready_fn):
def generate_test_description():
dut_process = get_test_process_action()

ld = launch.LaunchDescription([
dut_process,

# Start tests right away - no need to wait for anything
launch.actions.OpaqueFunction(function=lambda context: ready_fn()),
launch_testing.actions.ReadyToTest(),
])

# Items in this dictionary will be added to the test cases as an attribute based on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@
import launch
import launch.actions
import launch_testing
import launch_testing.actions
import launch_testing.util

import pytest


@pytest.mark.launch_test
@launch_testing.parametrize('arg_param', ['thing=On', 'thing=Off', 'flag1'])
def generate_test_description(arg_param, ready_fn):
def generate_test_description(arg_param):

terminating_process = launch.actions.ExecuteProcess(
cmd=[
Expand All @@ -48,7 +49,7 @@ def generate_test_description(arg_param, ready_fn):
launch.LaunchDescription([
terminating_process,
launch_testing.util.KeepAliveProc(),
launch.actions.OpaqueFunction(function=lambda context: ready_fn())
launch_testing.actions.ReadyToTest(),
]),
{'dut_process': terminating_process}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import launch.actions

import launch_testing
import launch_testing.actions
import launch_testing.asserts
import launch_testing.markers
import launch_testing.tools
Expand All @@ -46,10 +47,8 @@ def get_test_process_action(*, args=[]):

@pytest.mark.launch_test
@launch_testing.markers.keep_alive
def generate_test_description(ready_fn):
return launch.LaunchDescription([
launch.actions.OpaqueFunction(function=lambda context: ready_fn()),
])
def generate_test_description():
return launch.LaunchDescription([launch_testing.actions.ReadyToTest()])


class TestTerminatingProc(unittest.TestCase):
Expand Down