diff options
author | Jeff Quast <contact@jeffquast.com> | 2015-09-22 12:59:40 -0700 |
---|---|---|
committer | Jeff Quast <contact@jeffquast.com> | 2015-09-22 12:59:40 -0700 |
commit | 6d7abc17a1b017e7bc7b68dbdc836d8f515ee6de (patch) | |
tree | 93c17ad0eec5f2451a17b470c0c12086843cd3b6 | |
parent | ea586fb9a545854f9b1212779653ec80f3428a2c (diff) | |
download | pexpect-6d7abc17a1b017e7bc7b68dbdc836d8f515ee6de.tar.gz |
test_winsize: exit winsize test cleanly, dont kill
We are getting intermittent errors from coverage.py
through py.test during tests/test_winsize.py on MacOS::
coverage.misc.CoverageException: Couldn't read data from '/opt/TeamCity/buildAgent/work/210ae16cc3f30c30/pexpect/.coverage.osx.pexpect.org.86667.769538': CoverageException: Doesn't seem to be a coverage.py data file
Our MacOS build slave is particularly slow with disk i/o,
and I think the p.close() actually resorts to the eventual
'kill -9', creating a miscomplete coverage file.
-rwxr-xr-x | tests/test_winsize.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/test_winsize.py b/tests/test_winsize.py index be16773..9c1a509 100755 --- a/tests/test_winsize.py +++ b/tests/test_winsize.py @@ -31,7 +31,8 @@ class TestCaseWinsize(PexpectTestCase.PexpectTestCase): .format(self=self), timeout=3) # default size by PtyProcess class is 24 rows by 80 columns. p.expect_exact('Initial Size: (24, 80)') - p.close() + p.sendcontrol('c') + p.wait() def test_initial_winsize_by_dimension(self): """ Assert user-parameter window dimension size is initial. """ @@ -39,7 +40,8 @@ class TestCaseWinsize(PexpectTestCase.PexpectTestCase): .format(self=self), timeout=3, dimensions=(40, 100)) p.expect_exact('Initial Size: (40, 100)') - p.close() + p.sendcontrol('c') + p.wait() def test_setwinsize(self): """ Ensure method .setwinsize() sends signal caught by child. """ @@ -50,7 +52,8 @@ class TestCaseWinsize(PexpectTestCase.PexpectTestCase): p.expect_exact('READY') p.setwinsize(19, 84) p.expect_exact('SIGWINCH: (19, 84)') - p.close() + p.sendcontrol('c') + p.wait() if __name__ == '__main__': unittest.main() |