From 4511949f6e37a1582129cdc68e0176bf263b5b76 Mon Sep 17 00:00:00 2001 From: Jeff Quast Date: Fri, 24 Apr 2015 22:50:13 -0700 Subject: workaround travis-ci's strange EOF issue --- tests/test_interact.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/test_interact.py b/tests/test_interact.py index 06fc44a..e635cb0 100755 --- a/tests/test_interact.py +++ b/tests/test_interact.py @@ -66,9 +66,12 @@ class InteractTestCase (PexpectTestCase.PexpectTestCase): p.expect(b'alpha') p.expect(b'beta') p.sendeof() - p.expect_exact('') - p.expect_exact('Escaped interact') - p.expect(pexpect.EOF) + # strangely, on travis-ci, sendeof() terminates the subprocess, + # it doesn't receive ^D, just immediately throws EOF. + idx = p.expect_exact(['', pexpect.EOF]) + if idx == 0: + p.expect_exact('Escaped interact') + p.expect(pexpect.EOF) assert not p.isalive() assert p.exitstatus == 0 @@ -81,9 +84,12 @@ class InteractTestCase (PexpectTestCase.PexpectTestCase): p.expect('ɑlpha') p.expect('Βeta') p.sendeof() - p.expect_exact('') - p.expect_exact('Escaped interact') - p.expect(pexpect.EOF) + # strangely, on travis-ci, sendeof() terminates the subprocess, + # it doesn't receive ^D, just immediately throws EOF. + idx = p.expect_exact(['', pexpect.EOF]) + if idx == 0: + p.expect_exact('Escaped interact') + p.expect(pexpect.EOF) assert not p.isalive() assert p.exitstatus == 0 -- cgit v1.2.1