mirror of
https://github.com/clearml/wexpect-venv
synced 2025-03-03 18:51:55 +00:00
[FIX] python example issue: #7, [TEST] appveyor codecov
This commit is contained in:
parent
fb58f671af
commit
813a462475
@ -35,6 +35,7 @@ child.expect('>')
|
|||||||
child.sendline('ls')
|
child.sendline('ls')
|
||||||
child.expect('>')
|
child.expect('>')
|
||||||
print(child.before)
|
print(child.before)
|
||||||
|
child.sendline('exit')
|
||||||
```
|
```
|
||||||
|
|
||||||
For more information see [examples](./examples) folder.
|
For more information see [examples](./examples) folder.
|
||||||
|
@ -9,4 +9,4 @@ test_script:
|
|||||||
- tox
|
- tox
|
||||||
|
|
||||||
after_test:
|
after_test:
|
||||||
- bash <(curl -s https://codecov.io/bash)
|
- codecov
|
||||||
|
@ -3,20 +3,25 @@
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import sys
|
import sys
|
||||||
import wexpect
|
import wexpect
|
||||||
|
import os
|
||||||
|
|
||||||
|
here = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
|
||||||
# Path of python executable:
|
# Path of python executable:
|
||||||
pythonInterp = sys.executable
|
pythonInterp = sys.executable
|
||||||
prompt = ': '
|
prompt = ': '
|
||||||
|
|
||||||
# Start the child process
|
# Start the child process
|
||||||
p = wexpect.spawn(pythonInterp, ['foo.py'])
|
p = wexpect.spawn(pythonInterp, [here + '\\foo.py'])
|
||||||
|
|
||||||
# Wait for prompt
|
# Wait for prompt
|
||||||
p.expect(prompt)
|
p.expect(prompt)
|
||||||
|
print(p.before)
|
||||||
|
|
||||||
# Send the 'small integer'
|
# Send the 'small integer'
|
||||||
p.sendline('3')
|
p.sendline('3')
|
||||||
p.expect(prompt)
|
p.expect(prompt)
|
||||||
|
print(p.before)
|
||||||
|
|
||||||
# print the texts
|
# print the texts
|
||||||
print(p.before, end='')
|
print(p.before, end='')
|
||||||
|
@ -28,4 +28,4 @@ test =
|
|||||||
coverage
|
coverage
|
||||||
tox
|
tox
|
||||||
setuptools>=38.0
|
setuptools>=38.0
|
||||||
|
codecov
|
@ -2430,7 +2430,7 @@ class Wtty:
|
|||||||
raise
|
raise
|
||||||
self.switchBack()
|
self.switchBack()
|
||||||
|
|
||||||
class ConsoleReader:
|
class ConsoleReader: # pragma: no cover
|
||||||
|
|
||||||
def __init__(self, path, pid, tid, env = None, cp=None, logdir=None):
|
def __init__(self, path, pid, tid, env = None, cp=None, logdir=None):
|
||||||
self.logdir = logdir
|
self.logdir = logdir
|
||||||
|
Loading…
Reference in New Issue
Block a user