summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjquast <contact@jeffquast.com>2014-03-06 23:05:43 -0800
committerjquast <contact@jeffquast.com>2014-03-06 23:05:43 -0800
commit0600cbc0d356cfa2e2fbcf2428214726085b19e2 (patch)
treebfcf07113348bea8b1dbb5363efc86371c9a47cb
parent5a393f4af034e180beb275d90b1d8f7475b68a63 (diff)
downloadpexpect-0600cbc0d356cfa2e2fbcf2428214726085b19e2.tar.gz
assertRaises is not 2.6->3.x compatible
-rw-r--r--tests/test_pxssh.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_pxssh.py b/tests/test_pxssh.py
index 0ee5bf5..0ff092c 100644
--- a/tests/test_pxssh.py
+++ b/tests/test_pxssh.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python
import os
+
import unittest
from pexpect import pxssh
@@ -39,9 +40,14 @@ class PxsshTestCase(SSHTestBase):
def test_failed_set_unique_prompt(self):
ssh = pxssh.pxssh()
ssh.set_unique_prompt = lambda: False
- with self.assertRaises(pxssh.ExceptionPxssh):
+ try:
ssh.login('server', 'me', password='s3cret',
auto_prompt_reset=True)
+ except pxssh.ExceptionPxssh:
+ pass
+ else:
+ assert False, 'should have raised exception, pxssh.ExceptionPxssh'
+
if __name__ == '__main__':
unittest.main()