launch_testing.io_handler module

A module providing process IO capturing classes.

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.io_handler.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.io_handler.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)