Patchwork D3877: tests: don't reimplement enumerate() in run-tests

login
register
mail settings
Submitter phabricator
Date July 5, 2018, 12:10 p.m.
Message ID <222b89dd11aa51bb5b88c25605d6232a@localhost.localdomain>
Download mbox | patch
Permalink /patch/32631/
State Not Applicable
Headers show

Comments

phabricator - July 5, 2018, 12:10 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG296648321710: tests: don&#039;t reimplement enumerate() in run-tests (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3877?vs=9424&id=9448

REVISION DETAIL
  https://phab.mercurial-scm.org/D3877

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1480,10 +1480,8 @@ 
                 if expected.get(pos, None):
                     els = expected[pos]
 
-                i = 0
                 optional = []
-                while i < len(els):
-                    el = els[i]
+                for i, el in enumerate(els):
 
                     r = self.linematch(el, lout)
                     if isinstance(r, str):
@@ -1512,8 +1510,6 @@ 
                                 if not self._iftest(conditions):
                                     optional.append(i)
 
-                    i += 1
-
                 if r:
                     if r == "retry":
                         continue