[PATCH 4 of 7] tests/dumbhttp: use absolute_import

Gregory Szorc gregory.szorc at gmail.com
Mon Dec 7 00:52:11 CST 2015


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1449468727 28800
#      Sun Dec 06 22:12:07 2015 -0800
# Node ID f3a9af8129869171744848eb97ae7631d79e0a96
# Parent  12078b309115a5fda0ddbfa89eac5252dbe3a258
tests/dumbhttp: use absolute_import

diff --git a/tests/dumbhttp.py b/tests/dumbhttp.py
--- a/tests/dumbhttp.py
+++ b/tests/dumbhttp.py
@@ -1,18 +1,27 @@
 #!/usr/bin/env python
 
+from __future__ import absolute_import
+
 """
 Small and dumb HTTP server for use in tests.
 """
 
-from optparse import OptionParser
-import BaseHTTPServer, SimpleHTTPServer, signal, sys
+import optparse
+import BaseHTTPServer
+import signal
+import SimpleHTTPServer
+import sys
 
-from mercurial import cmdutil
+from mercurial import (
+    cmdutil,
+)
+
+OptionParser = optparse.OptionParser
 
 class simplehttpservice(object):
     def __init__(self, host, port):
         self.address = (host, port)
     def init(self):
         self.httpd = BaseHTTPServer.HTTPServer(
             self.address, SimpleHTTPServer.SimpleHTTPRequestHandler)
     def run(self):
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
@@ -138,17 +138,16 @@
   mercurial/scmposix.py not using absolute_import
   mercurial/scmutil.py not using absolute_import
   mercurial/scmwindows.py not using absolute_import
   mercurial/similar.py not using absolute_import
   mercurial/store.py not using absolute_import
   mercurial/util.py not using absolute_import
   mercurial/windows.py not using absolute_import
   setup.py not using absolute_import
-  tests/dumbhttp.py not using absolute_import
   tests/fakedirstatewritetime.py not using absolute_import
   tests/fakepatchtime.py not using absolute_import
   tests/filterpyflakes.py not using absolute_import
   tests/filterpyflakes.py requires print_function
   tests/generate-working-copy-states.py not using absolute_import
   tests/generate-working-copy-states.py requires print_function
   tests/get-with-headers.py not using absolute_import
   tests/get-with-headers.py requires print_function


More information about the Mercurial-devel mailing list