Environment Management (functional_harness/env_general.py)

Assorted context managers for setting up the test environment

background_proc(argv, verbose=False, *args, **kwargs)[source]

Context manager for scoping the lifetime of a subprocess.Popen call

Parameters
  • argv – The command to be executed

  • verbose – If False, redirect the X server’s stdout and stderr to /dev/null

  • args (Any) – Positional arguments to pass to subprocess.Popen

  • kwargs (Any) – Keyword arguments to pass to subprocess.Popen

Return type

Generator[None, None, None]

env_vars(new)[source]

Context manager to temporarily change environment variables

Parameters

new (Dict[str, str]) – Items to be added to os.environ for the lifetime of the context manager.

Return type

Generator[None, None, None]