tests/run-tests.py
changeset 46072 9e785d940525
parent 46071 cc0b332ab9fc
child 46092 af3a6900f893
equal deleted inserted replaced
46071:cc0b332ab9fc 46072:9e785d940525
  3482                 % (exename, pyexename, exedir)
  3482                 % (exename, pyexename, exedir)
  3483             )
  3483             )
  3484             path = os.environ['PATH'].split(os.pathsep)
  3484             path = os.environ['PATH'].split(os.pathsep)
  3485             while exedir in path:
  3485             while exedir in path:
  3486                 path.remove(exedir)
  3486                 path.remove(exedir)
  3487             os.environ['PATH'] = os.pathsep.join([exedir] + path)
  3487 
       
  3488             # Binaries installed by pip into the user area like pylint.exe may
       
  3489             # not be in PATH by default.
       
  3490             extra_paths = [exedir]
       
  3491             vi = sys.version_info
       
  3492             if 'APPDATA' in os.environ:
       
  3493                 scripts_dir = os.path.join(
       
  3494                     os.environ['APPDATA'],
       
  3495                     'Python',
       
  3496                     'Python%d%d' % (vi[0], vi[1]),
       
  3497                     'Scripts',
       
  3498                 )
       
  3499 
       
  3500                 if vi.major == 2:
       
  3501                     scripts_dir = os.path.join(
       
  3502                         os.environ['APPDATA'],
       
  3503                         'Python',
       
  3504                         'Scripts',
       
  3505                     )
       
  3506 
       
  3507                 extra_paths.append(scripts_dir)
       
  3508 
       
  3509             os.environ['PATH'] = os.pathsep.join(extra_paths + path)
  3488             if not self._findprogram(pyexename):
  3510             if not self._findprogram(pyexename):
  3489                 print("WARNING: Cannot find %s in search path" % pyexename)
  3511                 print("WARNING: Cannot find %s in search path" % pyexename)
  3490 
  3512 
  3491     def _installhg(self):
  3513     def _installhg(self):
  3492         """Install hg into the test environment.
  3514         """Install hg into the test environment.