def METHOD_NAME(
    process_list,
    command_list,
    expected_pid,
    expected_stdout,
    monkeypatch,
    capsys,
):
    """Finds correct process for command line or returns None."""
    monkeypatch.setattr("psutil.process_iter", lambda attrs: process_list)
    found_pid = get_process_id_by_command(command_list=command_list, logger=Log())
    assert found_pid == expected_pid
    assert capsys.readouterr().out == expected_stdout