diff options
author | Ryan Petrello <lists@ryanpetrello.com> | 2018-05-21 13:51:50 -0400 |
---|---|---|
committer | Ryan Petrello <lists@ryanpetrello.com> | 2018-05-21 14:02:34 -0400 |
commit | d57a6d9dc2311d5d14f73c3b76359b4fb9cb71cc (patch) | |
tree | 45cc5716f7f99930a4daac6b5d11538511adb6a3 /tests | |
parent | 4507924a1ebd8b0677a0f67cb1f67eb531221241 (diff) | |
download | pexpect-git-d57a6d9dc2311d5d14f73c3b76359b4fb9cb71cc.tar.gz |
properly handle read timeouts with use_poll=True
see: https://github.com/pexpect/pexpect/issues/491
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test_misc.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_misc.py b/tests/test_misc.py index 118de2e..6052b6a 100755 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -87,6 +87,12 @@ class TestCaseMisc(PexpectTestCase.PexpectTestCase): remaining = child.read().replace(_CAT_EOF, b'') self.assertEqual(remaining, b'abc\r\n') + def test_read_poll_timeout(self): + " Test use_poll properly times out " + child = pexpect.spawn('sleep 5', use_poll=True) + with self.assertRaises(pexpect.TIMEOUT): + child.expect(pexpect.EOF, timeout=1) + def test_readline_bin_echo(self): " Test spawn('echo'). " # given, |