def patched_prompt(questions, text, **kwargs):
    """Create a prompt where the input and output are predefined."""

    def run(inp):
        # noinspection PyUnresolvedReferences
        inp.send_text(text)
        result = prompt(questions, input=inp, output=DummyOutput(), **kwargs)
        return result

    return execute_with_input_pipe(run)
Create a prompt where the input and output are predefined.
tests/utils.py