Skip to content

Commit

Permalink
test: fix failing tests when run in parallel
Browse files Browse the repository at this point in the history
Fixes #5327.

Normally when running tests with Textual, the default size of the
simulated app is 80x24. However it seems when tests are run in parallel
with xdist on Python 3.13, `app.console.height` returns the _actual_
height of the terminal, causing tests to fail.
  • Loading branch information
TomJGooding committed Jan 16, 2025
1 parent dc71564 commit db0335b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/text_area/test_selection_bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ async def test_cursor_page_down(app: TextAreaApp):
await pilot.press("pagedown")
margin = 2
assert text_area.selection == Selection.cursor(
(app.console.height - 1 - margin, 1)
(app.size.height - margin, 1)
)


Expand All @@ -268,7 +268,7 @@ async def test_cursor_page_up(app: TextAreaApp):
await pilot.press("pageup")
margin = 2
assert text_area.selection == Selection.cursor(
(100 - app.console.height + 1 + margin, 1)
(100 - app.size.height + margin, 1)
)


Expand Down

0 comments on commit db0335b

Please sign in to comment.