diff options
| author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-03-02 19:31:53 -0500 |
|---|---|---|
| committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-03-02 19:31:53 -0500 |
| commit | 8eebaae9328aa89d3c86a382dcd9aafea7eb3728 (patch) | |
| tree | 2331d4b296aad466e9663053fae243083c083a8c /tests | |
| parent | 388d48682823a192d349ad877b1fd1ae5d92df44 (diff) | |
| download | cmd2-git-8eebaae9328aa89d3c86a382dcd9aafea7eb3728.tar.gz | |
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
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_cmd2.py | 35 |
1 files changed, 0 insertions, 35 deletions
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() |
