mirror of
https://github.com/python/cpython.git
synced 2025-09-24 01:13:22 +00:00
gh-131507: Clean up tests and type checking for _pyrepl
(#131509)
This commit is contained in:
parent
d3f6063af1
commit
5d8e981c84
14 changed files with 234 additions and 135 deletions
|
@ -7,7 +7,7 @@ from test.support import os_helper
|
|||
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 @@ class TestConsole(TestCase):
|
|||
# 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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue