]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-121351: Skip test_not_wiping_history_file() if no readline (GH-121422)...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 6 Jul 2024 23:18:20 +0000 (01:18 +0200)
committerGitHub <noreply@github.com>
Sat, 6 Jul 2024 23:18:20 +0000 (23:18 +0000)
gh-121351: Skip test_not_wiping_history_file() if no readline (GH-121422)
(cherry picked from commit 68e279b37aae3019979a05ca55f462b11aac14be)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Lib/test/test_pyrepl/test_pyrepl.py

index 7621b8af808f532808272a43e0e6f6abe5c8e538..015b690566223d2b62da064ce3bb8381a7ee6cda 100644 (file)
@@ -11,6 +11,7 @@ from unittest import TestCase, skipUnless
 from unittest.mock import patch
 from test.support import force_not_colorized
 from test.support import SHORT_TIMEOUT
+from test.support.import_helper import import_module
 from test.support.os_helper import unlink
 
 from .support import (
@@ -902,6 +903,9 @@ class TestMain(TestCase):
         self.assertNotIn("Traceback", output)
 
     def test_not_wiping_history_file(self):
+        # skip, if readline module is not available
+        import_module('readline')
+
         hfile = tempfile.NamedTemporaryFile(delete=False)
         self.addCleanup(unlink, hfile.name)
         env = os.environ.copy()