diff tests/test.py @ 65:83327bc715be

make the virtualenv convenience method return more stuff
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 01 Mar 2012 18:31:52 -0800
parents bb8d993376aa
children e62d2fddb275
line wrap: on
line diff
--- a/tests/test.py	Thu Mar 01 18:15:34 2012 -0800
+++ b/tests/test.py	Thu Mar 01 18:31:52 2012 -0800
@@ -21,11 +21,15 @@
 def create_virtualenv(path):
     """create a virtualenv and return the path to the python interpreter therein"""
     virtualenv.create_environment(path)
-    for python in (('bin', 'python'), ('Scripts', 'python.exe')):
-        python = os.path.join(path, *python)
-        if os.path.exists(python):
-            return python
-    raise Exception("Python binary not found in %s" % path)
+    for scripts, ext in (('bin', ''), ('Scripts', '.exe')):
+        scripts = os.path.join(path, scripts)
+        if os.path.exists(scripts):
+            break
+    else:
+        raise Exception("bin/Scripts not found in %s" % path)
+    binaries = ['python', 'easy_install', 'pip']
+    binaries = dict([(i, i + ext) for i in binaries])
+    return type('virtualenv', (), binaries)
 
 def run_tests(raise_on_error=False, report_first=False):