gh-121351: Skip test_not_wiping_history_file() if no readline (#121422)

This commit is contained in:
Sergey B Kirpichev 2024-07-07 01:53:54 +03:00 committed by GitHub
parent 114389470e
commit 68e279b37a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View 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()