Author: Stefano Rivera <[email protected]>
Branch:
Changeset: r1003:201c71e13ab7
Date: 2012-10-21 19:32 +0200
http://bitbucket.org/cffi/cffi/changeset/201c71e13ab7/
Log: subprocess.check_call is prettier
diff --git a/testing/test_zintegration.py b/testing/test_zintegration.py
--- a/testing/test_zintegration.py
+++ b/testing/test_zintegration.py
@@ -4,7 +4,7 @@
def create_venv(name):
tmpdir = udir.join(name)
- subprocess.call(['virtualenv', '-p', sys.executable, str(tmpdir)])
+ subprocess.check_call(['virtualenv', '-p', sys.executable, str(tmpdir)])
return tmpdir
SNIPPET_DIR = py.path.local(__file__).join('..', 'snippets')
@@ -19,14 +19,10 @@
python_f.write(py.code.Source(python_snippet))
try:
os.chdir(str(SNIPPET_DIR.join(dirname)))
- venv = venv_dir.join('bin/activate')
- p = subprocess.Popen(['bash', '-c', '. %(venv)s && '
- 'python setup.py clean && '
- 'python setup.py install && '
- 'python %(python_f)s' % locals()])
- p.communicate()
- if p.returncode != 0:
- raise Exception("crashed")
+ vp = str(venv_dir.join('bin/python'))
+ subprocess.check_call((vp, 'setup.py', 'clean'))
+ subprocess.check_call((vp, 'setup.py', 'install'))
+ subprocess.check_call((vp, str(python_f)))
finally:
os.chdir(olddir)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit