Skip to content

Conversation

TomJGooding
Copy link
Collaborator

@TomJGooding TomJGooding commented Sep 29, 2025

Note that the test will even fail locally with this change instead:

-        footer_key_clicked = await pilot.mouse_down("FooterKey")
+        footer_key_clicked = await pilot.click("FooterKey")
         assert footer_key_clicked is True  # Sanity check
         await pilot.pause()
>           assert footer_key_clicked is True  # Sanity check
E           assert False is True

Since the footer reacts to mouse down, when the click has finished on mouse up the screen is now the modal screen.

@TomJGooding
Copy link
Collaborator Author

TomJGooding commented Sep 29, 2025

And fails in CI with this change:

-        await pilot.pause(0.4)
+        await pilot.pause()
FAILED tests/test_modal.py::test_modal_pop_screen - textual.css.query.NoMatches: No nodes match 'FooterKey' on Screen(id='_default')

@TomJGooding TomJGooding marked this pull request as ready for review September 29, 2025 11:57
@TomJGooding
Copy link
Collaborator Author

Maybe there is a better fix, but this should hopefully unblock for the time being and at least the sanity check will help debug if the footer key is actually clicked.

@willmcgugan
Copy link
Member

Going with the other branch. Although the fix isn't all that satisfactory, it avoids the arbitrary sleep which is often a red flag and addresses some genuine issues.

@TomJGooding TomJGooding deleted the test-modal-flaky-test-redux-redux branch October 6, 2025 14:28
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.

2 participants