summaryrefslogtreecommitdiff
path: root/tests/test_interact.py
diff options
context:
space:
mode:
authorThomas Kluyver <takowl@gmail.com>2013-09-25 17:51:33 -0700
committerThomas Kluyver <takowl@gmail.com>2013-09-25 17:51:33 -0700
commit9eb6df99667b23fb503cff5d454604ffefeb6cbe (patch)
treee24ee1f1eb42ad24351b51422f295c2764f095bd /tests/test_interact.py
parent4c19cc491fa2ad0ee1cad29078411e0b05a52e28 (diff)
downloadpexpect-git-9eb6df99667b23fb503cff5d454604ffefeb6cbe.tar.gz
Fix interact_unicode test
Diffstat (limited to 'tests/test_interact.py')
-rwxr-xr-xtests/test_interact.py28
1 files changed, 17 insertions, 11 deletions
diff --git a/tests/test_interact.py b/tests/test_interact.py
index 5d071d5..3288b29 100755
--- a/tests/test_interact.py
+++ b/tests/test_interact.py
@@ -19,6 +19,8 @@ PEXPECT LICENSE
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
'''
+from __future__ import print_function
+
import pexpect
import unittest
import PexpectTestCase
@@ -41,17 +43,21 @@ class InteractTestCase (PexpectTestCase.PexpectTestCase):
def test_interact_unicode (self):
p = pexpect.spawnu('%s interact_unicode.py' % (self.PYTHONBIN,))
- p.sendline (u'Hello')
- p.sendline (u'theré')
- p.sendline (u'Mr. Pyþon')
- p.expect (u'Hello')
- p.expect (u'theré')
- p.expect (u'Mr. Pyþon')
- assert p.isalive()
- p.sendeof ()
- p.expect (pexpect.EOF)
- assert not p.isalive()
- assert p.exitstatus == 0, (p.exitstatus, p.before)
+ try:
+ p.sendline (u'Hello')
+ p.sendline (u'theré')
+ p.sendline (u'Mr. Pyþon')
+ p.expect (u'Hello')
+ p.expect (u'theré')
+ p.expect (u'Mr. Pyþon')
+ assert p.isalive()
+ p.sendeof ()
+ p.expect (pexpect.EOF)
+ assert not p.isalive()
+ assert p.exitstatus == 0, (p.exitstatus, p.before)
+ except:
+ print(p.before)
+ raise
if __name__ == '__main__':