Skip to content

[v2] Fix tests to use pipe input#10024

Merged
kdaily merged 1 commit intoaws:v2from
kdaily:kdaily-fix-ecs-expressgateway-ptk-tests
Jan 30, 2026
Merged

[v2] Fix tests to use pipe input#10024
kdaily merged 1 commit intoaws:v2from
kdaily:kdaily-fix-ecs-expressgateway-ptk-tests

Conversation

@kdaily
Copy link
Member

@kdaily kdaily commented Jan 27, 2026

Issue #, if available:

NA

Description of changes:

Test initialization fails on some systems due to not having stdin, specifically when the test suite is invoked within a script.

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

It also replaces some PTK app session fixtures with one that already existed in tests/conftest.py that has the correct behavior:

def ptk_app_session():

Last, it combines two tests into one parametrized one over values of the use color mode.

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

@kdaily kdaily added the v2 label Jan 27, 2026
@kdaily kdaily force-pushed the kdaily-fix-ecs-expressgateway-ptk-tests branch from 1bacc0c to 0984a10 Compare January 27, 2026 21:25

def test_watcher_accepts_use_color_parameter(self, watcher_app_session):
@pytest.mark.parametrize("use_color", [True, False])
def test_watcher_accepts_use_color_parameter(self, ptk_app_session, use_color):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to investigate a bit as to why this specific test requires the ptk_app_session fixture and an injected Display object.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this module, this is the only test where a display is initialized inside of a ECSExpressGatewayServiceWatcher. The only other test using ECSExpressGatewayServiceWatcher, test_invalid_display_mode_raises_error, errors out expectedly with an invalid mode before creating a display.

@kdaily kdaily requested a review from aemous January 28, 2026 16:12
@kdaily kdaily force-pushed the kdaily-fix-ecs-expressgateway-ptk-tests branch from 0984a10 to cf87509 Compare January 28, 2026 16:37
@kdaily kdaily marked this pull request as ready for review January 28, 2026 17:00
Test initialization fails on some systems due to not having stdin,
specifically when the test suite is invoked within a script.

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

It also replaces some PTK app session fixtures with one that already
existed in `tests/conftest.py` that has the correct behavior
(`ptk_app_session`).
@kdaily kdaily force-pushed the kdaily-fix-ecs-expressgateway-ptk-tests branch from cf87509 to 08f9263 Compare January 28, 2026 17:54
Copy link
Contributor

@aemous aemous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kdaily kdaily merged commit 86ca0fa into aws:v2 Jan 30, 2026
59 of 61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants