comparison tests/run-tests.py @ 47577:2ee81806831f

run-tests: setup "correct" python earlier I don't see any good reason to wait. This result in slightly simpler code. Differential Revision: https://phab.mercurial-scm.org/D11047
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 09 Jul 2021 17:02:01 +0200
parents c3c38eb08465
children 05abe1ff1edd
comparison
equal deleted inserted replaced
47576:c3c38eb08465 47577:2ee81806831f
3417 runner = TextTestRunner(self, verbosity=verbosity) 3417 runner = TextTestRunner(self, verbosity=verbosity)
3418 3418
3419 if self.options.list_tests: 3419 if self.options.list_tests:
3420 result = runner.listtests(suite) 3420 result = runner.listtests(suite)
3421 else: 3421 else:
3422 self._usecorrectpython()
3422 if self._installdir: 3423 if self._installdir:
3423 self._installhg() 3424 self._installhg()
3424 self._checkhglib("Testing") 3425 self._checkhglib("Testing")
3425 else:
3426 self._usecorrectpython()
3427 if self.options.chg: 3426 if self.options.chg:
3428 assert self._installdir 3427 assert self._installdir
3429 self._installchg() 3428 self._installchg()
3430 if self.options.rhg: 3429 if self.options.rhg:
3431 assert self._installdir 3430 assert self._installdir
3703 else: 3702 else:
3704 sys.stdout.write(line) 3703 sys.stdout.write(line)
3705 sys.exit(1) 3704 sys.exit(1)
3706 os.chdir(self._testdir) 3705 os.chdir(self._testdir)
3707 3706
3708 self._usecorrectpython()
3709
3710 hgbat = os.path.join(self._bindir, b'hg.bat') 3707 hgbat = os.path.join(self._bindir, b'hg.bat')
3711 if os.path.isfile(hgbat): 3708 if os.path.isfile(hgbat):
3712 # hg.bat expects to be put in bin/scripts while run-tests.py 3709 # hg.bat expects to be put in bin/scripts while run-tests.py
3713 # installation layout put it in bin/ directly. Fix it 3710 # installation layout put it in bin/ directly. Fix it
3714 with open(hgbat, 'rb') as f: 3711 with open(hgbat, 'rb') as f: