[3.13] gh-131507: Clean up tests and type checking for _pyrepl (GH-131509) (GH-131546)

(cherry picked from commit 5d8e981c84)
This commit is contained in:
Łukasz Langa 2025-03-21 17:25:45 +01:00 committed by GitHub
parent 0a22407a23
commit 095c1263eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 234 additions and 133 deletions

View file

@ -7,7 +7,7 @@
from unittest import TestCase
from unittest.mock import MagicMock, call, patch, ANY
from .support import handle_all_events, code_to_events
from .support import handle_all_events, code_to_events, reader_no_colors
try:
from _pyrepl.console import Event
@ -252,7 +252,9 @@ def test_resize_bigger_on_multiline_function(self, _os_write):
# fmt: on
events = itertools.chain(code_to_events(code))
reader, console = handle_events_short_unix_console(events)
reader, console = handle_events_short_unix_console(
events, prepare_reader=reader_no_colors
)
console.height = 2
console.getheightwidth = MagicMock(lambda _: (2, 80))