diff options
| author | jquast <contact@jeffquast.com> | 2013-09-22 21:58:45 -0700 |
|---|---|---|
| committer | jquast <contact@jeffquast.com> | 2013-09-22 21:58:45 -0700 |
| commit | 2b97dfe378727c2612db035e9cd9aa2c6503db75 (patch) | |
| tree | 46d7b47bedd151515d9121715fff7deb7eac774e /tests/test_expect.py | |
| parent | 8e2e7ba23ee747f7589cbf2007a09f9cfc7f63c7 (diff) | |
| download | pexpect-2b97dfe378727c2612db035e9cd9aa2c6503db75.tar.gz | |
py3 has slightly different TypeError message
Diffstat (limited to 'tests/test_expect.py')
| -rwxr-xr-x | tests/test_expect.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_expect.py b/tests/test_expect.py index 85edfaa..7bffece 100755 --- a/tests/test_expect.py +++ b/tests/test_expect.py @@ -487,9 +487,11 @@ class ExpectTestCase (PexpectTestCase.PexpectTestCase): assert False, 'TypeError should have been raised' except TypeError: err = sys.exc_info()[1] - e_msg = "pattern is <type 'int'> at position 0, must be one of" + e_msg_py2 = "pattern is <type 'int'> at position 0, must be one of" + e_msg_py3 = "pattern is <type 'int'> at position 0, must be one of" if hasattr(err, 'message'): - assert err.message.startswith(e_msg), err.message + assert (err.message.startswith(e_msg_py2) + or err.message.startswith(e_msg_py3)), err.message else: assert str(err).startswith(e_msg), err except AttributeError: |
