From 813a4624753aa8a9a51980244c2c41903a65ebeb Mon Sep 17 00:00:00 2001 From: Benedek Racz Date: Thu, 5 Sep 2019 17:51:27 +0200 Subject: [PATCH] [FIX] python example issue: #7, [TEST] appveyor codecov --- README.md | 1 + appveyor.yml | 2 +- examples/python.py | 7 ++++++- setup.cfg | 2 +- wexpect.py | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7a525ff..264d1e8 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ child.expect('>') child.sendline('ls') child.expect('>') print(child.before) +child.sendline('exit') ``` For more information see [examples](./examples) folder. diff --git a/appveyor.yml b/appveyor.yml index 1ac029c..fb74771 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,4 +9,4 @@ test_script: - tox after_test: -- bash <(curl -s https://codecov.io/bash) +- codecov diff --git a/examples/python.py b/examples/python.py index 94597c1..9bc899c 100644 --- a/examples/python.py +++ b/examples/python.py @@ -3,20 +3,25 @@ from __future__ import print_function import sys import wexpect +import os + +here = os.path.dirname(os.path.realpath(__file__)) # Path of python executable: pythonInterp = sys.executable prompt = ': ' # Start the child process -p = wexpect.spawn(pythonInterp, ['foo.py']) +p = wexpect.spawn(pythonInterp, [here + '\\foo.py']) # Wait for prompt p.expect(prompt) +print(p.before) # Send the 'small integer' p.sendline('3') p.expect(prompt) +print(p.before) # print the texts print(p.before, end='') diff --git a/setup.cfg b/setup.cfg index 63f313a..0dc5e2e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,4 +28,4 @@ test = coverage tox setuptools>=38.0 - \ No newline at end of file + codecov \ No newline at end of file diff --git a/wexpect.py b/wexpect.py index edabd50..7fe20c4 100644 --- a/wexpect.py +++ b/wexpect.py @@ -2430,7 +2430,7 @@ class Wtty: raise self.switchBack() -class ConsoleReader: +class ConsoleReader: # pragma: no cover def __init__(self, path, pid, tid, env = None, cp=None, logdir=None): self.logdir = logdir