diff options
author | Jeff Quast <contact@jeffquast.com> | 2015-09-21 13:28:53 -0700 |
---|---|---|
committer | Jeff Quast <contact@jeffquast.com> | 2015-09-21 13:28:53 -0700 |
commit | 6ca747813437c0d4ea0ac49f060361d8a98a130a (patch) | |
tree | d19e14e9a3a8db82e7fd3af475a1f4f526e9146a | |
parent | 6524c84771e03ab8a2759d66b5544ba7c14ccdb9 (diff) | |
download | pexpect-6ca747813437c0d4ea0ac49f060361d8a98a130a.tar.gz |
Accomidate PyPy more
-rw-r--r-- | tests/test_unicode.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/test_unicode.py b/tests/test_unicode.py index 337028d..5d65c73 100644 --- a/tests/test_unicode.py +++ b/tests/test_unicode.py @@ -177,8 +177,13 @@ class UnicodeTests(PexpectTestCase.PexpectTestCase): """ Ensure a program can be executed with unicode arguments. """ p = pexpect.spawn(u'{self.PYTHONBIN} sleep_for.py ǝpoɔıun' .format(self=self), timeout=5, encoding='utf8') - p.expect(u'(could not convert string to float:.*ǝpoɔıun' # py2.7/3.4 - u'|invalid literal for float():.*ǝpoɔıun)') # pypy !? + # we expect the program to error, and display a ValueError for the + # float literal. It will also print it back to us, with the exception + # of PyPy, which seems to use a form of repr() of the bytestream. + if platform.python_implementation() == 'PyPy': + p.expect(u'ǝpoɔıun') + else: + p.expect(ur'\\xc7\\x9dpo\\xc9\\x94\\xc4\\xb1un') p.expect(pexpect.EOF) assert not p.isalive() assert p.exitstatus != 0 # child process could not convert to float |