summaryrefslogtreecommitdiff
path: root/tests/test_misc.py
diff options
context:
space:
mode:
authorThomas Kluyver <takowl@gmail.com>2013-10-09 11:54:17 -0700
committerThomas Kluyver <takowl@gmail.com>2013-10-09 11:54:17 -0700
commit287789e06b6579f07aa3ecdec94934ce37ce03be (patch)
tree015b49389b62140a0fe921215f776db717432f35 /tests/test_misc.py
parent5ead18e1afe818fe6abfa7494c7d3655911626ec (diff)
downloadpexpect-287789e06b6579f07aa3ecdec94934ce37ce03be.tar.gz
Call readlines() before stdout is discarded
Closes gh-12 (hopefully)
Diffstat (limited to 'tests/test_misc.py')
-rwxr-xr-xtests/test_misc.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/test_misc.py b/tests/test_misc.py
index 5c7f546..377bb0c 100755
--- a/tests/test_misc.py
+++ b/tests/test_misc.py
@@ -117,14 +117,15 @@ class TestCaseMisc(PexpectTestCase.PexpectTestCase):
child.sendline ("123")
time.sleep(0.5)
child.sendeof()
- time.sleep(1) # time for child to "complete" ;/
- assert not child.isalive(), child.isalive()
- assert child.exitstatus == 0, child.exitstatus
page = b''.join(child.readlines()).replace(_CAT_EOF, b'')
assert (page == b'abc\r\nabc\r\n123\r\n123\r\n' or
page == b'abc\r\n123\r\nabc\r\n123\r\n'), (
"readlines() did not work. page=%r" % (page,))
+ time.sleep(1) # time for child to "complete" ;/
+ assert not child.isalive(), child.isalive()
+ assert child.exitstatus == 0, child.exitstatus
+
def test_write (self):
child = pexpect.spawn('cat')
child.write('a')