Patchwork D7707: tests-pure: fixing test-parseindex2

login
register
mail settings
Submitter phabricator
Date Dec. 20, 2019, 9:13 p.m.
Message ID <b02c699f8f72bd796ff334c8261f0804@localhost.localdomain>
Download mbox | patch
Permalink /patch/44013/
State Not Applicable
Headers show

Comments

phabricator - Dec. 20, 2019, 9:13 p.m.
Closed by commit rHGac627ed8a911: tests-pure: fixing test-parseindex2 (authored by gracinet).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7707?vs=18899&id=18900

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7707/new/

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

AFFECTED FILES
  tests/test-parseindex2.py

CHANGE DETAILS




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

Patch

diff --git a/tests/test-parseindex2.py b/tests/test-parseindex2.py
--- a/tests/test-parseindex2.py
+++ b/tests/test-parseindex2.py
@@ -267,11 +267,13 @@ 
         appendrev(6)
         self.assertEqual(len(index), 7)
 
-        del index[1:7]
+        del index[1:-1]
 
         # assertions that failed before correction
         self.assertEqual(len(index), 1)  # was 4
-        self.assertEqual(index.headrevs(), [0])  # gave ValueError
+        headrevs = getattr(index, 'headrevs', None)
+        if headrevs is not None:  # not implemented in pure
+            self.assertEqual(index.headrevs(), [0])  # gave ValueError
 
 
 if __name__ == '__main__':