diff options
author | Thomas Kluyver <takowl@gmail.com> | 2013-10-09 13:39:49 -0700 |
---|---|---|
committer | Thomas Kluyver <takowl@gmail.com> | 2013-10-09 13:39:49 -0700 |
commit | ce38b3c2a69c3fbf1c95b12b4f8c738cfc2d22ef (patch) | |
tree | c011b52083924ddd0d47d9fd5addb8e1c56cb93d | |
parent | c4e5c2483590fd7690836911fd76b6d9eb47a07c (diff) | |
parent | 651d5d017861a46ab505b7d34c171dff8263b728 (diff) | |
download | pexpect-ce38b3c2a69c3fbf1c95b12b4f8c738cfc2d22ef.tar.gz |
Merge pull request #13 from pexpect/mac-test-readlines
Mac test readlines
-rwxr-xr-x | tests/test_misc.py | 7 | ||||
-rwxr-xr-x | tests/test_run.py | 1 |
2 files changed, 5 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') diff --git a/tests/test_run.py b/tests/test_run.py index ce470bb..6346ced 100755 --- a/tests/test_run.py +++ b/tests/test_run.py @@ -84,6 +84,7 @@ class RunUnicodeFuncTestCase(RunFuncTestCase): return True # Stop the child process output = pexpect.runu(sys.executable + ' echo_w_prompt.py', + env={'PYTHONIOENCODING':'utf-8'}, events={pattern:callback}) assert isinstance(output, unicode_type), type(output) assert '<out>'+c in output, output |