summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pyrepl/test_unix_console.py
diff options
context:
space:
mode:
authorDino Viehland <dinoviehland@gmail.com>2024-05-31 07:49:03 (GMT)
committerGitHub <noreply@github.com>2024-05-31 07:49:03 (GMT)
commit0d07182821fad7b95a043d006f1ce13a2d22edcb (patch)
treedd51773d847f35d791bb9436352d39500845f288 /Lib/test/test_pyrepl/test_unix_console.py
parent13a5fdc72f701c053b96abea48cd8f2775e9418e (diff)
downloadcpython-0d07182821fad7b95a043d006f1ce13a2d22edcb.zip
cpython-0d07182821fad7b95a043d006f1ce13a2d22edcb.tar.gz
cpython-0d07182821fad7b95a043d006f1ce13a2d22edcb.tar.bz2
gh-111201: Support pyrepl on Windows (#119559)
Co-authored-by: Anthony Shaw <anthony.p.shaw@gmail.com> Co-authored-by: Ɓukasz Langa <lukasz@langa.pl>
Diffstat (limited to 'Lib/test/test_pyrepl/test_unix_console.py')
-rw-r--r--Lib/test/test_pyrepl/test_unix_console.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/test/test_pyrepl/test_unix_console.py b/Lib/test/test_pyrepl/test_unix_console.py
index e1faa00..d0b98f1 100644
--- a/Lib/test/test_pyrepl/test_unix_console.py
+++ b/Lib/test/test_pyrepl/test_unix_console.py
@@ -1,12 +1,16 @@
import itertools
+import sys
+import unittest
from functools import partial
from unittest import TestCase
from unittest.mock import MagicMock, call, patch, ANY
from .support import handle_all_events, code_to_events
-from _pyrepl.console import Event
-from _pyrepl.unix_console import UnixConsole
-
+try:
+ from _pyrepl.console import Event
+ from _pyrepl.unix_console import UnixConsole
+except ImportError:
+ pass
def unix_console(events, **kwargs):
console = UnixConsole()
@@ -67,6 +71,7 @@ TERM_CAPABILITIES = {
}
+@unittest.skipIf(sys.platform == "win32", "No Unix event queue on Windows")
@patch("_pyrepl.curses.tigetstr", lambda s: TERM_CAPABILITIES.get(s))
@patch(
"_pyrepl.curses.tparm",