From 9998875dd92e62a33db8394c22ce177d8c582d5d Mon Sep 17 00:00:00 2001 From: Benedek Racz Date: Wed, 22 Jan 2020 12:23:01 +0100 Subject: [PATCH] [FIX] add psutil to requirements; [FIX] test_buffer_interface: the assertion should have been delayed --- examples/hello_wexpect.py | 6 ++++-- requirements.txt | 3 ++- tests/test_expect.py | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) 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 ()