1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
From: Stefano Rivera <stefanor@debian.org>
Date: Wed, 23 Sep 2020 23:55:45 -0700
Subject: Tests: Skip readline tests raising InvalidTerminal
We run the tests under TERM=dumb.
PyPy doesn't emulate the readline module perfectly and throws an
exception here.
Forwarded: https://foss.heptapod.net/pypy/pypy/-/issues/3308
---
lib-python/3/test/test_readline.py | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/lib-python/3/test/test_readline.py b/lib-python/3/test/test_readline.py
index f711ba8..c8e4815 100644
--- a/lib-python/3/test/test_readline.py
+++ b/lib-python/3/test/test_readline.py
@@ -10,6 +10,7 @@ import subprocess
import sys
import tempfile
import unittest
+from pyrepl.unix_console import InvalidTerminal
from test.support import import_module, unlink, temp_dir, TESTFN, verbose
from test.support.script_helper import assert_python_ok
@@ -45,7 +46,10 @@ class TestHistoryManipulation (unittest.TestCase):
"""
def testHistoryUpdates(self):
- readline.clear_history()
+ try:
+ readline.clear_history()
+ except InvalidTerminal as e:
+ raise unittest.SkipTest(e)
readline.add_history("first line")
readline.add_history("second line")
@@ -107,7 +111,10 @@ class TestHistoryManipulation (unittest.TestCase):
readline.write_history_file(hfilename)
def test_nonascii_history(self):
- readline.clear_history()
+ try:
+ readline.clear_history()
+ except InvalidTerminal as e:
+ raise unittest.SkipTest(e)
try:
readline.add_history("entrée 1")
except UnicodeEncodeError as err:
|