diff options
author | Thomas Kluyver <takowl@gmail.com> | 2015-12-14 12:23:47 +0100 |
---|---|---|
committer | Thomas Kluyver <takowl@gmail.com> | 2015-12-14 12:23:47 +0100 |
commit | 8af334bf38a79778d96eed63e99a0a5e4b2f6f80 (patch) | |
tree | 39fbc3e7246df5db004c2038e10f307f759d16ec /tests | |
parent | 1192bec9cdc385e30be98c01d6d1d6f5a1a0ff75 (diff) | |
parent | 011ad6090e183ce359c0a74bbd2f2530e1d5178c (diff) | |
download | pexpect-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.py | 11 |
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.' |