From 8eebaae9328aa89d3c86a382dcd9aafea7eb3728 Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Fri, 2 Mar 2018 19:31:53 -0500 Subject: Added use of pytest-forked to CI unit test runs Due to apparent bugs in pyparsing, this can significantly speed up unit test execution. Also: - Removed use of pexpect in unit tests --- tests/test_cmd2.py | 35 ----------------------------------- 1 file changed, 35 deletions(-) (limited to 'tests/test_cmd2.py') diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 5facd0ac..6de86b2d 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -11,7 +11,6 @@ import io import tempfile import mock -import pexpect import pytest import six @@ -1502,37 +1501,3 @@ def test_poutput_none(base_app): out = base_app.stdout.buffer expected = '' assert out == expected - - -@pytest.mark.skipif(sys.platform == 'win32' or sys.platform.startswith('lin'), - reason="pexpect doesn't have a spawn() function on Windows and readline doesn't work on TravisCI") -def test_persistent_history(request): - """Will run on macOS to verify expected persistent history behavior.""" - test_dir = os.path.dirname(request.module.__file__) - persistent_app = os.path.join(test_dir, '..', 'examples', 'persistent_history.py') - - python = 'python3' - if six.PY2: - python = 'python2' - - command = '{} {}'.format(python, persistent_app) - - # Start an instance of the persistent history example and send it a few commands - child = pexpect.spawn(command) - prompt = 'ph> ' - child.expect(prompt) - child.sendline('help') - child.expect(prompt) - child.sendline('help history') - child.expect(prompt) - child.sendline('quit') - child.close() - - # Start a 2nd instance of the persistent history example and send it an up arrow to verify persistent history - up_arrow = '\x1b[A' - child2 = pexpect.spawn(command) - child2.expect(prompt) - child2.send(up_arrow) - child2.expect('quit') - assert child2.after == b'quit' - child2.close() -- cgit v1.2.1