From 1b46e6b6262109d4befbb5a1c534ffde25d702fb Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Fri, 29 Apr 2016 18:59:23 -0400 Subject: Skip a test if readline isn't available. Closes #230 --- src/mailman/commands/tests/test_shell.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/mailman/commands/tests/test_shell.py') diff --git a/src/mailman/commands/tests/test_shell.py b/src/mailman/commands/tests/test_shell.py index 153591f5a..12e78c1ab 100644 --- a/src/mailman/commands/tests/test_shell.py +++ b/src/mailman/commands/tests/test_shell.py @@ -27,6 +27,12 @@ from mailman.testing.helpers import configuration from mailman.testing.layers import ConfigLayer from unittest.mock import patch +try: + import readline # noqa + has_readline = True +except ImportError: + has_readline = False + class FakeArgs: interactive = None @@ -64,6 +70,7 @@ class TestShell(unittest.TestCase): positional, keywords = mock.call_args self.assertEqual(keywords['banner'], 'my banner\n') + @unittest.skipUnless(has_readline, 'readline module is not available') @configuration('shell', history_file='$var_dir/history.py') def test_history_file(self): args = FakeArgs() -- cgit v1.2.3-70-g09d2