speedup test_pyrepl (#132688)

speedup test_unix_console.py and test_windows_console.py
This commit is contained in:
Chris Eibl 2025-04-19 03:12:40 +02:00 committed by GitHub
parent c9a855a9e0
commit 815061cbab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View file

@ -23,6 +23,7 @@ def unix_console(events, **kwargs):
height = kwargs.get("height", 25) height = kwargs.get("height", 25)
width = kwargs.get("width", 80) width = kwargs.get("width", 80)
console.getheightwidth = MagicMock(side_effect=lambda: (height, width)) console.getheightwidth = MagicMock(side_effect=lambda: (height, width))
console.wait = MagicMock()
console.prepare() console.prepare()
for key, val in kwargs.items(): for key, val in kwargs.items():

View file

@ -31,6 +31,7 @@ class WindowsConsoleTests(TestCase):
def console(self, events, **kwargs) -> Console: def console(self, events, **kwargs) -> Console:
console = WindowsConsole() console = WindowsConsole()
console.get_event = MagicMock(side_effect=events) console.get_event = MagicMock(side_effect=events)
console.wait = MagicMock()
console._scroll = MagicMock() console._scroll = MagicMock()
console._hide_cursor = MagicMock() console._hide_cursor = MagicMock()
console._show_cursor = MagicMock() console._show_cursor = MagicMock()