[PATCH 2 of 2] test-url: skip test when ssl module is unavailable

Gilles Moris gilles.moris at free.fr
Tue Oct 12 16:05:06 CDT 2010


On Tuesday 12 October 2010 09:49:04 pm Augie Fackler wrote:
> test-url: skip test when ssl module is unavailable
>
> diff --git a/tests/test-url.py b/tests/test-url.py
> --- a/tests/test-url.py
> +++ b/tests/test-url.py
> @@ -1,4 +1,9 @@
>  #!/usr/bin/env python
> +import sys
> +try:
> +    import ssl
> +except ImportError:
> +    sys.exit(80)

With my py2.5, I have this error in test-url.py:

ERROR: /home/morisgi/Documents/hg.crew/tests/test-url.py output changed and 
returned error code 1
--- /home/morisgi/Documents/hg.crew/tests/test-url.py.out
+++ /home/morisgi/Documents/hg.crew/tests/test-url.py.err
@@ -1,0 +1,6 @@
+Traceback (most recent call last):
+  File "/home/morisgi/Documents/hg.crew/tests/test-url.py", line 38, in 
<module>
+    'example.com'),
+  File "/tmp/hgtests.RgXoC3/install/lib/python/mercurial/url.py", line 498, 
in _verifycert
+    if notafter and time.time() > ssl.cert_time_to_seconds(notafter):
+NameError: global name 'ssl' is not defined


Is this error you mention ?
Does this mean that url._verifycert() cannot be called for py < 2.6 ?
Is that the reason why this test failure is eluded ?

Regards.
Gilles.


More information about the Mercurial-devel mailing list