summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornoah <noah@656d521f-e311-0410-88e0-e7920216d269>2007-12-29 18:56:35 +0000
committernoah <noah@656d521f-e311-0410-88e0-e7920216d269>2007-12-29 18:56:35 +0000
commitd56bee4d7edef76a12f032ad3d295bc117183c9c (patch)
treef83018d6b534ac0d232be4a65bce7ae9a3c18249
parentd894fb5ca40463900ec174ad66ae43f0e3d78a49 (diff)
downloadpexpect-d56bee4d7edef76a12f032ad3d295bc117183c9c.tar.gz
Made assert messages more informative.
git-svn-id: http://pexpect.svn.sourceforge.net/svnroot/pexpect/trunk@508 656d521f-e311-0410-88e0-e7920216d269
-rwxr-xr-xpexpect/tests/test_misc.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/pexpect/tests/test_misc.py b/pexpect/tests/test_misc.py
index e0e699d..91ad465 100755
--- a/pexpect/tests/test_misc.py
+++ b/pexpect/tests/test_misc.py
@@ -26,11 +26,16 @@ class TestCaseMisc(PexpectTestCase.PexpectTestCase):
child.sendline ("abc")
child.sendline ("123")
child.sendeof()
- assert child.readline(0) == '', "readline(0) did not return ''"
- assert child.readline() == 'abc\r\n', "readline() did not return 'abc\\r\\n'"
- assert child.readline(2) == 'abc\r\n', "readline(2) did not return 'abc\\r\\n'"
- assert child.readline(1) == '123\r\n', "readline(1) did not return '123\\r\\n'"
- assert child.readline() == '123\r\n', "readline() did not return '123\\r\\n'"
+ line1 = child.readline(0)
+ line2 = child.readline()
+ line3 = child.readline(2)
+ line4 = child.readline(1)
+ line5 = child.readline()
+ assert line1 == '', "readline(0) did not return ''. Returned: " + repr(line1)
+ assert line2 == 'abc\r\n', "readline() did not return 'abc\\r\\n'. Returned: " + repr(line2)
+ assert line3 == 'abc\r\n', "readline(2) did not return 'abc\\r\\n'. Returned: " + repr(line3)
+ assert line4 == '123\r\n', "readline(1) did not return '123\\r\\n'. Returned: " + repr(line4)
+ assert line5 == '123\r\n', "readline() did not return '123\\r\\n'. Returned: " + repr(line5)
def test_iter (self):
child = pexpect.spawn('cat')
child.sendline ("abc")