Skip to content

Conversation

@kdaily
Copy link
Member

@kdaily kdaily commented Nov 20, 2025

Issue #, if available:

Description of changes:

This fix addresses failures encountered on some systems when running the startlivetail unit tests through the AWS CLI test runner script at scripts/ci/run-tests. This change adds an optional app_input parameter so that the test can be run with create_pipe_input() to replace the input for unit testing.

According to prompt toolkit documentation:

During the creation of a prompt_toolkit Application, we can specify
what input and output device to be used. By default, these are output
objects that correspond with sys.stdin and sys.stdout. In unit tests
however, we want to replace these.

  • For the input, we want a “pipe input”. This is an input device,
    in which we can programmatically send some input. It can be created
    with create_pipe_input(), and that return either a PosixPipeInput or a
    Win32PipeInput depending on the platform.

Reference: https://python-prompt-toolkit.readthedocs.io/en/stable/pages/advanced_topics/unit_testing.html

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

This fix addresses failures encountered on some systems when running the
startlivetail unit tests through the AWS CLI test runner script at
`scripts/ci/run-tests`. According to prompt toolkit documentation:

> During the creation of a prompt_toolkit Application, we can specify
> what input and output device to be used. By default, these are output
> objects that correspond with sys.stdin and sys.stdout. In unit tests
> however, we want to replace these.
> - For the input, we want a “pipe input”. This is an input device,
> in which we can programmatically send some input. It can be created
> with create_pipe_input(), and that return either a PosixPipeInput or a
> Win32PipeInput depending on the platform.

Reference: https://python-prompt-toolkit.readthedocs.io/en/stable/pages/advanced_topics/unit_testing.html

This change adds an optional `app_input`` parameter so that the test can
be run with `create_pipe_input()` to replace the input for unit testing.
@kdaily kdaily force-pushed the startlivetail-stdin-test-fix branch from 55ebab5 to 41a578b Compare November 21, 2025 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant