[PATCH 6 of 8] tests: ignore http tests that are known wontfix failures on python 2.4

Mads Kiilerich mads at kiilerich.com
Sun Jan 19 18:32:30 CST 2014


# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1390177794 -3600
#      Mon Jan 20 01:29:54 2014 +0100
# Node ID 20666065e66b603a748a6c0dfed54c23dedfae17
# Parent  7a985a8337c0a6787208e848f046e1d6dc2d7d29
tests: ignore http tests that are known wontfix failures on python 2.4

As mentioned on http://bz.selenic.com/show_bug.cgi?id=2739#c17 , b3083042bdda
left test-http.t failing on Python < 2.4.3. Disabling the known failures make
the test pass on 2.4 so we can make sure we don't get more regressions.

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -248,6 +248,9 @@ def has_pygments():
     except ImportError:
         return False
 
+def has_python243():
+    return sys.version_info >= (2, 4, 3)
+
 def has_outer_repo():
     # failing for other reasons than 'no repo' imply that there is a repo
     return not matchoutput('hg root 2>&1',
@@ -320,6 +323,7 @@ checks = {
     "p4": (has_p4, "Perforce server and client"),
     "pyflakes": (has_pyflakes, "Pyflakes python linter"),
     "pygments": (has_pygments, "Pygments source highlighting library"),
+    "python243": (has_python243, "python >= 2.4.3"),
     "root": (has_root, "root permissions"),
     "serve": (has_serve, "platform and python can manage 'hg serve -d'"),
     "ssl": (has_ssl, "python >= 2.6 ssl module and python OpenSSL"),
diff --git a/tests/test-http.t b/tests/test-http.t
--- a/tests/test-http.t
+++ b/tests/test-http.t
@@ -163,6 +163,7 @@ test http authentication
   > getpass.getpass = newgetpass
   > EOF
 
+#if python243
   $ hg id http://localhost:$HGPORT2/
   abort: http authorization required for http://localhost:$HGPORT2/
   [255]
@@ -176,6 +177,7 @@ test http authentication
   password: 5fed3813f7f5
   $ hg id http://user:pass@localhost:$HGPORT2/
   5fed3813f7f5
+#endif
   $ echo '[auth]' >> .hg/hgrc
   $ echo 'l.schemes=http' >> .hg/hgrc
   $ echo 'l.prefix=lo' >> .hg/hgrc
@@ -187,6 +189,7 @@ test http authentication
   5fed3813f7f5
   $ hg id http://user@localhost:$HGPORT2/
   5fed3813f7f5
+#if python243
   $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1
   streaming all changes
   7 files to transfer, 916 bytes of data
@@ -200,6 +203,7 @@ test http authentication
   $ hg id http://user:pass2@localhost:$HGPORT2/
   abort: HTTP Error 403: no
   [255]
+#endif
 
   $ cd ..
 


More information about the Mercurial-devel mailing list