tests/run-tests.py
changeset 29485 6a98f9408a50
parent 29282 89822d7a9d5f
child 29518 348b2b9da703
--- 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