run#

pytest_bluezenv.run(*args, input=None, capture_output=False, timeout=None, check=False, **kwargs)[source]#

Run a command and log its output while it executes.

Parameters:
  • *args – positional arguments passed to subprocess.run.

  • input – standard input passed to the process.

  • capture_output (bool) – capture standard output and error.

  • timeout (float) – seconds to wait for completion.

  • check (bool) – raise for a non-zero exit status.

  • **kwargs – keyword arguments passed to subprocess.run.

Returns:

the completed command, with stdout and stderr filled when they were captured.

Return type:

subprocess.CompletedProcess

Example

result = run(["btmgmt", "info"], check=True, capture_output=True)