diff options
author | jquast <contact@jeffquast.com> | 2013-09-22 19:32:33 -0700 |
---|---|---|
committer | jquast <contact@jeffquast.com> | 2013-09-22 19:32:33 -0700 |
commit | c851a110a61f20c2163aacdf6afe210d572d777b (patch) | |
tree | 6b07f4c3638b22fe5552efe333e0397fa4d9c8fd /tests/test_run.py | |
parent | a83cf59505e18fd4ee0c84c4a1dd724e6f916e16 (diff) | |
download | pexpect-c851a110a61f20c2163aacdf6afe210d572d777b.tar.gz |
py2.5 compatibilities w/six.py
-except Exception as e:
+except Exception, err:
the unfortunate use of six.b('') instead of b''
print(arg0, arg1) => six.print_(arg0, arg1)
some autopep8 -i is definitely called for, some of these test cases are darn unreadable, but did partially pep8 some of the really-long-over-80col-lines.
Diffstat (limited to 'tests/test_run.py')
-rwxr-xr-x | tests/test_run.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_run.py b/tests/test_run.py index 3088ff2..50bae78 100755 --- a/tests/test_run.py +++ b/tests/test_run.py @@ -22,6 +22,7 @@ import pexpect import unittest import subprocess import PexpectTestCase +from pexpect import six # TODO Many of these test cases blindly assume that sequential # TODO listing of the /bin directory will yield the same results. @@ -40,9 +41,10 @@ class ExpectTestCase(PexpectTestCase.PexpectTestCase): assert exitstatus == 1, "Exit status of 'python exit1.py' should be 1." def test_run (self): - the_old_way = subprocess.check_output(['ls', '-l', '/bin']).rstrip() + the_old_way = subprocess.subprocess.Popen(args=['ls', '-l', '/bin'] + ).communicate()[0].rstrip() (the_new_way, exitstatus) = pexpect.run ('ls -l /bin', withexitstatus=1) - the_new_way = the_new_way.replace(b'\r',b'').rstrip() + the_new_way = the_new_way.replace(six.b('\r'),six.b('')).rstrip() self.assertEqual(the_old_way, the_new_way) self.assertEqual(exitstatus, 0) |