Skip to content

Commit a1802d6

Browse files
committed
Add a test for the escape keys
See #4038
1 parent 343893d commit a1802d6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/test_keys.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async def test_character_bindings():
2828
counter = 0
2929

3030
class BindApp(App):
31-
BINDINGS = [(".,~,space", "increment", "foo")]
31+
BINDINGS = [(".,~,space,escape", "increment", "foo")]
3232

3333
def action_increment(self) -> None:
3434
nonlocal counter
@@ -45,9 +45,12 @@ def action_increment(self) -> None:
4545
await pilot.press(" ")
4646
await pilot.pause()
4747
assert counter == 3
48+
await pilot.press("escape") # https://github.com/Textualize/textual/issues/4038
49+
await pilot.pause()
50+
assert counter == 4
4851
await pilot.press("x")
4952
await pilot.pause()
50-
assert counter == 3
53+
assert counter == 4
5154

5255

5356
def test_get_key_display():

0 commit comments

Comments
 (0)