launch_testing package

Subpackages

Submodules

Module contents

class launch_testing.ActiveIoHandler

Bases: object

Holds stdout captured from running processes.

The ActiveIoHandler is meant to be used when capturing is still in progress and provides additional synchronization, as well as methods to wait on incoming IO

append(process_io)
assertWaitFor(*args, **kwargs)
property io_event
process_names()

Get the name of all unique processes that generated IO.

Returns [string]:

processes()

Get an iterable of unique launch.events.process.RunningProcessEvent objects.

Returns [launch.actions.ExecuteProcess]:

track(process_name)
waitFor(expected_output, process=None, cmd_args=None, *, strict_proc_matching=True, output_filter=None, timeout=10, strip_ansi_escape_sequences=True, stream='stderr')
class launch_testing.ActiveProcInfoHandler

Bases: object

Allows tests to wait on process termination before proceeding.

append(process_info)
assertWaitForShutdown(process, cmd_args=None, *, timeout=10)
assertWaitForStartup(process, cmd_args=None, *, timeout=10)
property proc_event
process_names()

Get the name of all recorded processes.

Returns [string]:

processes()

Get the ExecuteProcess launch actions of all recorded processes.

Returns [launch.actions.ExecuteProcess]:

class launch_testing.IoHandler

Bases: object

Holds stdout captured from running processes.

This class provides helper methods to enumerate the captured IO by individual processes

append(process_io)
process_names()

Get the name of all unique processes that generated IO.

Returns [string]:

processes()

Get an iterable of unique launch.events.process.RunningProcessEvent objects.

Returns [launch.actions.ExecuteProcess]:

track(process_name)
class launch_testing.ProcInfoHandler

Bases: object

Captures exit codes from processes when they terminate.

append(process_info)
process_names()

Get the name of all recorded processes.

processes()

Get the ExecuteProcess launch actions of all recorded processes.

class launch_testing.ReadyAggregator(ready_fn, num_to_aggregate)

Bases: object

Calls a ready_fn parent function on the nth call to a child function.

ready_fn()
launch_testing.parametrize(argnames, argvalues)

Decorate a test launch description in a way that causes it to run with specified parameters.

This decorator behaves like the @pytest.mark.parametrize decorator.

Param:

argnames A comma separated list of argument names.

Param:

argvalues The values to use for arguments specified in argnames

launch_testing.post_shutdown_test()

Decorate tests that are meant to run after process shutdown.

launch_testing.ready_to_test_action_timeout(timeout)

Decorate a test launch description in a way that it adds ReadyToTest action timeout.

attribute to the function being decorated.

Param:

timeout Duration for which the ReadyToTest action waits for processes to start up