From 860750d338e1e63af7fd98add93f10dd1529d20d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 14 Jan 2026 21:36:09 +0000 Subject: [PATCH 1/2] Initial plan From c89803bf33f7e06a7087f4d51846cb98d70ddde7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 14 Jan 2026 21:40:31 +0000 Subject: [PATCH 2/2] Add test for WrongType exception propagation in query_one_optional Co-authored-by: willmcgugan <554369+willmcgugan@users.noreply.github.com> --- tests/test_query.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_query.py b/tests/test_query.py index b9dcbc6f8e..5fde811450 100644 --- a/tests/test_query.py +++ b/tests/test_query.py @@ -397,3 +397,8 @@ def compose(self) -> ComposeResult: assert isinstance(app.query_one_optional("Input"), Input) assert isinstance(app.query_one_optional(".bar"), Input) + + # Verify that WrongType exceptions still propagate + with pytest.raises(WrongType): + # Asking for a Label, but the widget is an Input + app.query_one_optional("#foo", Label)