run-tests: install hg after computing tests to run
authorSiddharth Agarwal <sid0@fb.com>
Tue, 06 Jun 2017 13:56:53 -0700
changeset 32703 9d1d3199382e
parent 32702 d0b9c36851f5
child 32704 1270b00a385d
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.
tests/run-tests.py
--- 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: