diff --git a/examples/hello_wexpect.py b/examples/hello_wexpect.py index c6ce839..d306bad 100644 --- a/examples/hello_wexpect.py +++ b/examples/hello_wexpect.py @@ -12,7 +12,8 @@ child = wexpect.spawn('cmd.exe') child.expect('>') # Prints the cmd's start message -print(child.before) +print(child.before, end='') +print(child.after, end='') # run list directory command child.sendline('ls') @@ -21,7 +22,8 @@ child.sendline('ls') child.expect('>') # Prints content of the directory -print(child.before) +print(child.before, end='') +print(child.after, end='') # Exit from cmd child.sendline('exit') diff --git a/requirements.txt b/requirements.txt index 5cd9eeb..633ed61 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ -pywin32>=220 \ No newline at end of file +pywin32>=220 +psutil>=5.0.0 diff --git a/tests/test_expect.py b/tests/test_expect.py index e2dd69a..e721301 100644 --- a/tests/test_expect.py +++ b/tests/test_expect.py @@ -267,7 +267,8 @@ class ExpectTestCase (PexpectTestCase.PexpectTestCase): def test_buffer_interface(self): p = wexpect.spawn('cat', timeout=5) p.sendline ('Hello') - p.expect ('Hello') + p.expect('Hello') + p.expect('lo') assert len(p.buffer) p.buffer = 'Testing' p.sendeof ()