def pytest_funcarg__child(request):
try:
pexpect = pytest.importorskip('pexpect')
except SyntaxError:
pytest.skip('pexpect wont work on py3k')
child = pexpect.spawn(sys.executable, ['-S'], timeout=10)
if sys.version_info >= (3, ):
child.logfile = sys.stdout.buffer
else:
child.logfile = sys.stdout
child.sendline('from pyrepl.python_reader import main')
child.sendline('main()')
return child
评论列表
文章目录