Mercurial > hg
diff tests/run-tests.py @ 29485:6a98f9408a50
py3: make files use absolute_import and print_function
This patch includes addition of absolute_import and print_function to the
files where they are missing. The modern importing conventions are also followed.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sun, 03 Jul 2016 22:28:24 +0530 |
parents | 89822d7a9d5f |
children | 348b2b9da703 |
line wrap: on
line diff
--- a/tests/run-tests.py Fri Jul 01 19:17:45 2016 -0700 +++ b/tests/run-tests.py Sun Jul 03 22:28:24 2016 +0530 @@ -43,31 +43,31 @@ # completes fairly quickly, includes both shell and Python scripts, and # includes some scripts that run daemon processes.) -from __future__ import print_function +from __future__ import absolute_import, print_function -from distutils import version import difflib +import distutils.version as version import errno import json import optparse import os +import random +import re import shutil -import subprocess import signal import socket +import subprocess import sys import tempfile +import threading import time -import random -import re -import threading -import killdaemons as killmod +import unittest +import xml.dom.minidom as minidom + try: import Queue as queue except ImportError: import queue -from xml.dom import minidom -import unittest if os.environ.get('RTUNICODEPEDANTRY', False): try: @@ -475,6 +475,7 @@ pass def killdaemons(pidfile): + import killdaemons as killmod return killmod.killdaemons(pidfile, tryhard=False, remove=True, logfn=vlog) @@ -2493,7 +2494,8 @@ def _outputcoverage(self): """Produce code coverage output.""" - from coverage import coverage + import coverage + coverage = coverage.coverage vlog('# Producing coverage report') # chdir is the easiest way to get short, relative paths in the