summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Quast <contact@jeffquast.com>2015-04-24 22:50:13 -0700
committerJeff Quast <contact@jeffquast.com>2015-04-24 23:00:49 -0700
commit4511949f6e37a1582129cdc68e0176bf263b5b76 (patch)
tree1eb44af04aaf125553dcc80e1743141a5f67fbba
parent2d35bbafa849db7a8e483c626d2d392469b82fb6 (diff)
downloadpexpect-git-4511949f6e37a1582129cdc68e0176bf263b5b76.tar.gz
workaround travis-ci's strange EOF issue
-rwxr-xr-xtests/test_interact.py18
1 files 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'<out>alpha')
p.expect(b'<out>beta')
p.sendeof()
- p.expect_exact('<eof>')
- 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(['<eof>', 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('<out>ɑlpha')
p.expect('<out>Βeta')
p.sendeof()
- p.expect_exact('<eof>')
- 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(['<eof>', pexpect.EOF])
+ if idx == 0:
+ p.expect_exact('Escaped interact')
+ p.expect(pexpect.EOF)
assert not p.isalive()
assert p.exitstatus == 0