launch_testing.asserts.assert_sequential_output module

A module providing process output sequence assertions.

To prevent pytest from rewriting this module assertions, please PYTEST_DONT_REWRITE. See https://docs.pytest.org/en/latest/assert.html#disabling-assert-rewriting for further reference.

class launch_testing.asserts.assert_sequential_output.SequentialTextChecker(output)

Bases: object

Helper class for asserting that text is found in a certain order.

assertInStdout(msg)
assertInText(msg)
get_nearby_lines()
launch_testing.asserts.assert_sequential_output.assertSequentialStdout(proc_output, process, cmd_args=None)

Create a context manager used to check stdout occured in a specific order.

Parameters:
  • proc_output – The captured output from a test run

  • process (A string (search by process name) or a launch.actions.ExecuteProcess object) – The process whose output will be searched

  • cmd_args – Optional. If ‘proc’ is a string, cmd_args will be used to disambiguate

processes with the same name. Pass launch_testing.asserts.NO_CMD_ARGS to match a proc without command arguments :type cmd_args: string