summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThomas Kluyver <takowl@gmail.com>2015-12-14 12:23:47 +0100
committerThomas Kluyver <takowl@gmail.com>2015-12-14 12:23:47 +0100
commit8af334bf38a79778d96eed63e99a0a5e4b2f6f80 (patch)
tree39fbc3e7246df5db004c2038e10f307f759d16ec /tests
parent1192bec9cdc385e30be98c01d6d1d6f5a1a0ff75 (diff)
parent011ad6090e183ce359c0a74bbd2f2530e1d5178c (diff)
downloadpexpect-git-8af334bf38a79778d96eed63e99a0a5e4b2f6f80.tar.gz
Merge pull request #310 from pexpect/bugfix-my_spawn-has_no-ptyproc
Bugfix: AttributeError: 'spawn' object has no attribute 'ptyproc'
Diffstat (limited to 'tests')
-rw-r--r--tests/test_repr.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_repr.py b/tests/test_repr.py
index ce618d4..ac33716 100644
--- a/tests/test_repr.py
+++ b/tests/test_repr.py
@@ -24,3 +24,14 @@ class TestCaseMisc(PexpectTestCase.PexpectTestCase):
# verify
assert isinstance(value, str)
+ def test_str_before_spawn(self):
+ """ Exercise derived spawn.__str__() """
+ # given,
+ child = pexpect.spawn(None, None)
+ child.read_nonblocking = lambda size, timeout: b''
+ try:
+ child.expect('alpha', timeout=0.1)
+ except pexpect.TIMEOUT as e:
+ str(e) # Smoketest
+ else:
+ assert False, 'TIMEOUT exception expected. No exception raised.'