changeset 28914:63fe5ddb8715

tests: make test-url use absolute_import
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 14 Apr 2016 00:53:35 +0530
parents b4048ce003fb
children 40afa22bee9b
files tests/test-check-py3-compat.t tests/test-url.py
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-check-py3-compat.t	Thu Apr 14 00:49:58 2016 +0530
+++ b/tests/test-check-py3-compat.t	Thu Apr 14 00:53:35 2016 +0530
@@ -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
--- a/tests/test-url.py	Thu Apr 14 00:49:58 2016 +0530
+++ b/tests/test-url.py	Thu Apr 14 00:53:35 2016 +0530
@@ -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