Patchwork D7023: tests: fix test-archive to specify feature as py38, not py-38

login
register
mail settings
Submitter phabricator
Date Oct. 8, 2019, 6:17 p.m.
Message ID <differential-rev-PHID-DREV-cewzu27gwycssvxscpwi-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/42109/
State Superseded
Headers show

Comments

phabricator - Oct. 8, 2019, 6:17 p.m.
spectral created this revision.
Herald added subscribers: mercurial-devel, mjpieters.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/hghave.py
  tests/test-archive.t

CHANGE DETAILS




To: spectral, #hg-reviewers
Cc: mjpieters, mercurial-devel
phabricator - Oct. 8, 2019, 7:44 p.m.
pulkit added a comment.


  Looks like D7016 <https://phab.mercurial-scm.org/D7016> fixed it. +1 to the docs you have added, if you rebase and resend with the commit message updated, I will be happy to push it.

REPOSITORY
  rHG Mercurial

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

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

To: spectral, #hg-reviewers, pulkit
Cc: mjpieters, mercurial-devel

Patch

diff --git a/tests/test-archive.t b/tests/test-archive.t
--- a/tests/test-archive.t
+++ b/tests/test-archive.t
@@ -132,7 +132,7 @@ 
   transfer-encoding: chunked
   
   body: size=408, sha1=8fa06531bddecc365a9f5edb0f88b65974bfe505 (no-py38 !)
-  body: size=506, sha1=70926a04cb8887d0bcccf5380488100a10222def (py-38 !)
+  body: size=506, sha1=70926a04cb8887d0bcccf5380488100a10222def (py38 !)
   % tar.bz2 and zip disallowed should both give 403
   403 Archive type not allowed: bz2
   content-type: text/html; charset=ascii
diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -60,7 +60,11 @@ 
 def checkvers(name, desc, vers):
     """Registers a check function for each of a series of versions.
 
-    vers can be a list or an iterator"""
+    vers can be a list or an iterator.
+
+    Produces a series of feature checks that have the form <name><vers> without
+    any punctuation (even if there's punctuation in 'vers'; i.e. this produces
+    'py38', not 'py3.8' or 'py-38')."""
 
     def decorator(func):
         def funcv(v):
@@ -757,6 +761,8 @@ 
     return (not has_chg()) and os.environ.get('HGDEMANDIMPORT') != 'disable'
 
 
+# Add "py27", "py35", ... as possible feature checks. Note that there's no
+# punctuation here.
 @checkvers("py", "Python >= %s", (2.7, 3.5, 3.6, 3.7, 3.8, 3.9))
 def has_python_range(v):
     major, minor = v.split('.')[0:2]