[PATCH 2 of 8 v3] tests: make test-url use absolute_import

Pulkit Goyal 7895pulkit at gmail.com
Wed Apr 13 16:01:45 EDT 2016


# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1460575415 -19800
#      Thu Apr 14 00:53:35 2016 +0530
# Node ID d5659ff88ab979482a71645facdf7f62591560de
# Parent  1feb980d4382736bc88a3e23a2bba7f8ee77f764
tests: make test-url use absolute_import

diff --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t
+++ b/tests/test-check-py3-compat.t
@@ -67,7 +67,6 @@
   tests/test-symlink-os-yes-fs-no.py not using absolute_import
   tests/test-trusted.py requires print_function
   tests/test-ui-color.py not using absolute_import
-  tests/test-url.py not using absolute_import
 
 #if py3exe
   $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs $PYTHON3 contrib/check-py3-compat.py
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,6 @@
-from __future__ import print_function
+from __future__ import absolute_import, print_function
+
+import doctest
 import os
 
 def check(a, b):
@@ -8,8 +10,11 @@
 def cert(cn):
     return {'subject': ((('commonName', cn),),)}
 
-from mercurial.sslutil import _verifycert
+from mercurial import (
+    sslutil,
+)
 
+_verifycert = sslutil._verifycert
 # Test non-wildcard certificates
 check(_verifycert(cert('example.com'), 'example.com'),
       None)
@@ -58,8 +63,6 @@
 check(_verifycert(cert(u'\u4f8b.jp'), 'example.jp'),
       'IDN in certificate not supported')
 
-import doctest
-
 def test_url():
     """
     >>> from mercurial.util import url


More information about the Mercurial-devel mailing list