run-tests: install hg after computing tests to run
We're going to add a way to list tests, and we don't need to install hg for
that.
--- a/tests/run-tests.py Tue Jun 06 13:52:25 2017 -0700
+++ b/tests/run-tests.py Tue Jun 06 13:56:53 2017 -0700
@@ -2346,15 +2346,6 @@
return self._gettest(desc, i)
try:
- if self._installdir:
- self._installhg()
- self._checkhglib("Testing")
- else:
- self._usecorrectpython()
- if self.options.chg:
- assert self._installdir
- self._installchg()
-
if self.options.restart:
orig = list(testdescs)
while testdescs:
@@ -2392,6 +2383,16 @@
if self.options.verbose:
verbosity = 2
runner = TextTestRunner(self, verbosity=verbosity)
+
+ if self._installdir:
+ self._installhg()
+ self._checkhglib("Testing")
+ else:
+ self._usecorrectpython()
+ if self.options.chg:
+ assert self._installdir
+ self._installchg()
+
result = runner.run(suite)
if result.failures: