comparison tests/test.py @ 68:e62d2fddb275

use the actual paths i mean
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 02 Mar 2012 09:36:58 -0800
parents 83327bc715be
children
comparison
equal deleted inserted replaced
67:cf03c3f2f98e 68:e62d2fddb275
18 import virtualenv 18 import virtualenv
19 from optparse import OptionParser 19 from optparse import OptionParser
20 20
21 def create_virtualenv(path): 21 def create_virtualenv(path):
22 """create a virtualenv and return the path to the python interpreter therein""" 22 """create a virtualenv and return the path to the python interpreter therein"""
23
23 virtualenv.create_environment(path) 24 virtualenv.create_environment(path)
25
24 for scripts, ext in (('bin', ''), ('Scripts', '.exe')): 26 for scripts, ext in (('bin', ''), ('Scripts', '.exe')):
25 scripts = os.path.join(path, scripts) 27 scripts = os.path.join(path, scripts)
26 if os.path.exists(scripts): 28 if os.path.exists(scripts):
27 break 29 break
28 else: 30 else:
29 raise Exception("bin/Scripts not found in %s" % path) 31 raise Exception("bin/Scripts not found in %s" % path)
30 binaries = ['python', 'easy_install', 'pip'] 32 binaries = ['python', 'easy_install', 'pip']
31 binaries = dict([(i, i + ext) for i in binaries]) 33 binaries = dict([(i, os.path.join(scripts, i + ext)) for i in binaries])
32 return type('virtualenv', (), binaries) 34 return type('virtualenv', (), binaries)
33 35
34 def run_tests(raise_on_error=False, report_first=False): 36 def run_tests(raise_on_error=False, report_first=False):
35 37
36 # add results here 38 # add results here