Bug 1681096 - python3 - pylint --py3k - W1619: from __future__ import division r=marionette-reviewers,perftest-reviewers,gbrown
authorBob Clary <bclary@bclary.com>
Fri, 11 Dec 2020 16:05:25 +0000
changeset 560614 2ae1358e9347b055fc7bb030266b279da93f1c3b
parent 560613 9e1d4db4e5d0c0352d5c8a5a94cb4f013913c702
child 560615 f12f5989419ac645e641036d9c3851170362fdef
push id38032
push usercsabou@mozilla.com
push dateTue, 15 Dec 2020 09:29:54 +0000
treeherdermozilla-central@f805f27183c3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarionette-reviewers, perftest-reviewers, gbrown
bugs1681096
milestone85.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1681096 - python3 - pylint --py3k - W1619: from __future__ import division r=marionette-reviewers,perftest-reviewers,gbrown Differential Revision: https://phabricator.services.mozilla.com/D98938
testing/awsy/awsy/process_perf_data.py
testing/condprofile/condprof/progress.py
testing/condprofile/condprof/util.py
testing/gtest/bench.py
testing/jsshell/benchmark.py
testing/marionette/client/marionette_driver/gestures.py
testing/marionette/client/marionette_driver/legacy_actions.py
testing/marionette/client/marionette_driver/marionette.py
testing/marionette/harness/marionette_harness/tests/unit/test_mouse_action.py
testing/mochitest/bisection.py
testing/mochitest/leaks.py
testing/mochitest/pywebsocket3/mod_pywebsocket/stream.py
testing/mochitest/runtests.py
testing/mozbase/manifestparser/manifestparser/filters.py
testing/mozbase/mozdevice/mozdevice/adb.py
testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/symbolication.py
testing/mozbase/mozlog/mozlog/formatters/tbplformatter.py
testing/mozbase/mozlog/mozlog/formatters/unittest.py
testing/mozbase/mozpower/mozpower/intel_power_gadget.py
testing/mozbase/mozpower/mozpower/mozpowerutils.py
testing/mozbase/mozprofile/tests/test_profile.py
testing/mozbase/mozrunner/mozrunner/devices/emulator_battery.py
testing/mozbase/mozrunner/mozrunner/utils.py
testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py
testing/mozharness/mozharness/base/diskutils.py
testing/mozharness/mozharness/base/python.py
testing/mozharness/scripts/release/update-verify-config-creator.py
testing/raptor/raptor/browsertime/base.py
testing/raptor/raptor/cpu.py
testing/raptor/raptor/filters.py
testing/raptor/raptor/output.py
testing/raptor/raptor/power.py
testing/raptor/raptor/webextension/base.py
testing/raptor/test/test_cpu.py
testing/talos/talos/filter.py
testing/talos/talos/heavy.py
testing/talos/talos/output.py
testing/talos/talos/scripts/report.py
testing/testinfo.py
testing/tps/tps/testrunner.py
testing/xpcshell/mach_commands.py
testing/xpcshell/runxpcshelltests.py
--- a/testing/awsy/awsy/process_perf_data.py
+++ b/testing/awsy/awsy/process_perf_data.py
@@ -1,14 +1,14 @@
 #!/usr/bin/env python
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 import os
 import sys
 import json
 import math
 import glob
 
 AWSY_PATH = os.path.dirname(os.path.realpath(__file__))
@@ -49,20 +49,22 @@ PERF_SUITES = [
     {"name": "Heap Unclassified", "node": "explicit/heap-unclassified"},
     {"name": "JS", "node": "js-main-runtime/"},
     {"name": "Images", "node": "explicit/images/"},
 ]
 
 
 def median(values):
     sorted_ = sorted(values)
+    # pylint --py3k W1619
     med = int(len(sorted_) / 2)
 
     if len(sorted_) % 2:
         return sorted_[med]
+    # pylint --py3k W1619
     return (sorted_[med - 1] + sorted_[med]) / 2
 
 
 def update_checkpoint_paths(checkpoint_files, checkpoints):
     """
     Updates checkpoints with memory report file fetched in data_path
     :param checkpoint_files: list of files in data_path
     :param checkpoints: The checkpoints to update the path of.
@@ -168,16 +170,17 @@ def create_suite(
             "lowerIsBetter": True,
             "unit": "bytes",
         }
         suite["subtests"].append(subtest)
         total += math.log(subtest["value"])
 
     # Add the geometric mean. For more details on the calculation see:
     #   https://en.wikipedia.org/wiki/Geometric_mean#Relationship_with_arithmetic_mean_of_logarithms
+    # pylint --py3k W1619
     suite["value"] = math.exp(total / len(checkpoints))
 
     return suite
 
 
 def create_perf_data(
     data_path, perf_suites=PERF_SUITES, checkpoints=CHECKPOINTS, extra_opts=None
 ):
--- a/testing/condprofile/condprof/progress.py
+++ b/testing/condprofile/condprof/progress.py
@@ -17,17 +17,17 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE
 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 """
 
-from __future__ import absolute_import
+from __future__ import absolute_import, division
 
 import sys
 import time
 
 STREAM = sys.stderr
 
 BAR_TEMPLATE = "%s[%s%s] %i/%i - %s\r"
 MILL_TEMPLATE = "%s %s %i/%i\r"
@@ -87,25 +87,27 @@ class Bar(object):
     def show(self, progress, count=None):
         if count is not None:
             self.expected_size = count
         if self.expected_size is None:
             raise Exception("expected_size not initialized")
         self.last_progress = progress
         if (time.time() - self.etadelta) > ETA_INTERVAL:
             self.etadelta = time.time()
+            # pylint --py3k W1619
             self.ittimes = self.ittimes[-ETA_SMA_WINDOW:] + [
                 -(self.start - time.time()) / (progress + 1)
             ]
             self.eta = (
                 sum(self.ittimes)
                 / float(len(self.ittimes))
                 * (self.expected_size - progress)
             )
             self.etadisp = self.format_time(self.eta)
+        # pylint --py3k W1619
         x = int(self.width * progress / self.expected_size)
         if not self.hide:
             if (progress % self.every) == 0 or (  # True every "every" updates
                 progress == self.expected_size
             ):  # And when we're done
                 STREAM.write(
                     BAR_TEMPLATE
                     % (
--- a/testing/condprofile/condprof/util.py
+++ b/testing/condprofile/condprof/util.py
@@ -1,16 +1,15 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 # This module needs to stay Python 2 and 3 compatible
 #
-from __future__ import absolute_import
-from __future__ import print_function
+from __future__ import absolute_import, division, print_function
 
 import platform
 import time
 import os
 import shutil
 import contextlib
 import yaml
 from subprocess import Popen, PIPE
@@ -240,16 +239,17 @@ def download_file(url, target=None):
     with open(target, "wb") as f:
         if TASK_CLUSTER:
             for chunk in req.iter_content(chunk_size=1024):
                 if chunk:
                     f.write(chunk)
                     f.flush()
         else:
             iter = req.iter_content(chunk_size=1024)
+            # pylint --py3k W1619
             size = total_length / 1024 + 1
             for chunk in progress.bar(iter, expected_size=size):
                 if chunk:
                     f.write(chunk)
                     f.flush()
 
     if etag is not None:
         with open(target + ".etag", "w") as f:
--- a/testing/gtest/bench.py
+++ b/testing/gtest/bench.py
@@ -1,23 +1,23 @@
 #!/usr/bin/env python3
 
-from __future__ import print_function
-
+from __future__ import division, print_function
 import sys
 import subprocess
 import json
 import statistics
 
 proc = subprocess.Popen(["./mach", "gtest", sys.argv[1]], stdout=subprocess.PIPE)
 for line in proc.stdout:
     if line.startswith(b"PERFHERDER_DATA:"):
         data = json.loads(line[len("PERFHERDER_DATA:") :].decode("utf8"))
         for suite in data["suites"]:
             for subtest in suite["subtests"]:
+                # pylint --py3k W1619
                 print(
                     "%4d.%03d ± %6s ms    %s.%s"
                     % (
                         subtest["value"] / 1000.0,
                         subtest["value"] % 1000,
                         "%.3f" % (statistics.stdev(subtest["replicates"]) / 1000),
                         suite["name"],
                         subtest["name"],
--- a/testing/jsshell/benchmark.py
+++ b/testing/jsshell/benchmark.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 import json
 import os
 import re
 import shutil
 import sys
 from abc import ABCMeta, abstractmethod, abstractproperty
 from argparse import ArgumentParser
@@ -132,16 +132,17 @@ class Benchmark(object):
 
 class RunOnceBenchmark(Benchmark):
     def collect_results(self):
         bench_total = 0
         # NOTE: for this benchmark we run the test once, so we have a single value array
         for bench, scores in self.scores.items():
             for score, values in scores.items():
                 test_name = "{}-{}".format(self.name, score)
+                # pylint --py3k W1619
                 mean = sum(values) / len(values)
                 self.suite["subtests"].append({"name": test_name, "value": mean})
                 bench_total += int(sum(values))
         self.suite["value"] = bench_total
 
 
 class Ares6(Benchmark):
     name = "ares6"
@@ -188,16 +189,17 @@ class Ares6(Benchmark):
 
         m = re.search("summary:\s*(\d+\.?\d*?) (\+-)?.+", line)
         if m:
             self.last_summary = float(m.group(1))
 
     def collect_results(self):
         for bench, scores in self.scores.items():
             for score, values in scores.items():
+                # pylint --py3k W1619
                 mean = sum(values) / len(values)
                 test_name = "{}-{}".format(bench, score)
                 self.suite["subtests"].append({"name": test_name, "value": mean})
 
         if self.last_summary:
             self.suite["value"] = self.last_summary
 
 
@@ -291,16 +293,17 @@ class WebToolingBenchmark(Benchmark):
             self.scores[self.name][subtest] = []
         self.scores[self.name][subtest].append(float(score))
 
     def collect_results(self):
         # NOTE: for this benchmark we run the test once, so we have a single value array
         for bench, scores in self.scores.items():
             for score_name, values in scores.items():
                 test_name = "{}-{}".format(self.name, score_name)
+                # pylint --py3k W1619
                 mean = sum(values) / len(values)
                 self.suite["subtests"].append(
                     {
                         "lowerIsBetter": self.subtests_lower_is_better,
                         "name": test_name,
                         "value": mean,
                     }
                 )
@@ -343,16 +346,17 @@ class Octane(RunOnceBenchmark):
             self.scores[self.name][subtest] = []
         self.scores[self.name][subtest].append(int(score))
 
     def collect_results(self):
         # NOTE: for this benchmark we run the test once, so we have a single value array
         for bench, scores in self.scores.items():
             for score_name, values in scores.items():
                 test_name = "{}-{}".format(self.name, score_name)
+                # pylint --py3k W1619
                 mean = sum(values) / len(values)
                 self.suite["subtests"].append({"name": test_name, "value": mean})
                 if score_name == "score":
                     bench_score = mean
         self.suite["value"] = bench_score
 
     def run(self):
         self._provision_benchmark_script()
--- a/testing/marionette/client/marionette_driver/gestures.py
+++ b/testing/marionette/client/marionette_driver/gestures.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import absolute_import
+from __future__ import absolute_import, division
 
 from .legacy_actions import MultiActions, Actions
 
 
 def smooth_scroll(
     marionette_session,
     start_element,
     axis,
@@ -65,27 +65,29 @@ def pinch(marionette_session, element, x
     :param x2, y2: 2nd finger starting position relative to the target
     :param x4, y4: 2nd finger ending position relative to the target
     :param duration: Amount of time in milliseconds to complete the pinch.
     """
     time = 0
     time_increment = 10
     if time_increment >= duration:
         time_increment = duration
+    # pylint --py3k W1619
     move_x1 = time_increment * 1.0 / duration * (x3 - x1)
     move_y1 = time_increment * 1.0 / duration * (y3 - y1)
     move_x2 = time_increment * 1.0 / duration * (x4 - x2)
     move_y2 = time_increment * 1.0 / duration * (y4 - y2)
     multiAction = MultiActions(marionette_session)
     action1 = Actions(marionette_session)
     action2 = Actions(marionette_session)
     action1.press(element, x1, y1)
     action2.press(element, x2, y2)
     while time < duration:
         time += time_increment
+        # pylint --py3k W1619
         action1.move_by_offset(move_x1, move_y1).wait(time_increment / 1000)
         action2.move_by_offset(move_x2, move_y2).wait(time_increment / 1000)
     action1.release()
     action2.release()
     multiAction.add(action1).add(action2).perform()
 
 
 def long_press_without_contextmenu(
--- a/testing/marionette/client/marionette_driver/legacy_actions.py
+++ b/testing/marionette/client/marionette_driver/legacy_actions.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import absolute_import
+from __future__ import absolute_import, division
 
 from . import errors
 from .marionette import MouseButton
 
 
 class Actions(object):
     """Represent a set of actions that are executed in a particular order.
 
@@ -213,22 +213,24 @@ class Actions(object):
         :param duration: Time needed for the flick gesture for complete (in
          milliseconds).
         """
         element = element.id
         elapsed = 0
         time_increment = 10
         if time_increment >= duration:
             time_increment = duration
+        # pylint --py3k W1619
         move_x = time_increment * 1.0 / duration * (x2 - x1)
         move_y = time_increment * 1.0 / duration * (y2 - y1)
         self.action_chain.append(["press", element, x1, y1])
         while elapsed < duration:
             elapsed += time_increment
             self.action_chain.append(["moveByOffset", move_x, move_y])
+            # pylint --py3k W1619
             self.action_chain.append(["wait", time_increment / 1000])
         self.action_chain.append(["release"])
         return self
 
     def long_press(self, element, time_in_seconds, x=None, y=None):
         """
         Performs a long press gesture on the target element.
 
--- a/testing/marionette/client/marionette_driver/marionette.py
+++ b/testing/marionette/client/marionette_driver/marionette.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import absolute_import
+from __future__ import absolute_import, division
 
 import base64
 import datetime
 import json
 import os
 import socket
 import sys
 import time
@@ -1190,16 +1190,17 @@ class Marionette(object):
         # fallback to processId can be removed in Firefox 55
         self.process_id = self.session.get(
             "moz:processID", self.session.get("processId")
         )
         self.profile = self.session.get("moz:profile")
 
         timeout = self.session.get("moz:shutdownTimeout")
         if timeout is not None:
+            # pylint --py3k W1619
             self.shutdown_timeout = timeout / 1000 + 10
 
         return self.session
 
     @property
     def test_name(self):
         return self._test_name
 
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_mouse_action.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_mouse_action.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import absolute_import
+from __future__ import absolute_import, division
 
 from six.moves.urllib.parse import quote
 
 from marionette_driver import By, errors, Wait
 from marionette_driver.keys import Keys
 
 from marionette_harness import MarionetteTestCase
 
@@ -40,16 +40,17 @@ class BaseMouseAction(MarionetteTestCase
           if (window.click_x && window.click_y) {
             return {x: window.click_x, y: window.click_y};
           }
         """,
             sandbox=None,
         )
 
     def get_element_center_point(self, elem):
+        # pylint --py3k W1619
         return {
             "x": elem.rect["x"] + elem.rect["width"] / 2,
             "y": elem.rect["y"] + elem.rect["height"] / 2,
         }
 
 
 class TestPointerActions(BaseMouseAction):
     def test_click_action(self):
--- a/testing/mochitest/bisection.py
+++ b/testing/mochitest/bisection.py
@@ -1,9 +1,9 @@
-from __future__ import print_function
+from __future__ import division, print_function
 
 import math
 import mozinfo
 
 
 class Bisect(object):
 
     "Class for creating, bisecting and summarizing for --bisect-chunk option."
@@ -134,16 +134,17 @@ class Bisect(object):
             return self.contents["testsToRun"]
 
         # Initialize the contents dict.
         if status:
             totalTests = len(self.contents["tests"])
             self.contents["start"] = 0
             self.contents["end"] = totalTests - 2
 
+        # pylint --py3k W1619
         mid = (self.contents["start"] + self.contents["end"]) / 2
         if "result" in self.contents:
             if self.contents["result"] == "PASS":
                 self.contents["end"] = mid
 
             elif self.contents["result"] == "FAIL":
                 self.contents["start"] = mid + 1
 
--- a/testing/mochitest/leaks.py
+++ b/testing/mochitest/leaks.py
@@ -1,15 +1,17 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/
 
 # The content of this file comes orginally from automationutils.py
 # and *should* be revised.
 
+from __future__ import division
+
 import re
 from operator import itemgetter
 
 RE_DOCSHELL = re.compile("I\/DocShellAndDOMWindowLeak ([+\-]{2})DOCSHELL")
 RE_DOMWINDOW = re.compile("I\/DocShellAndDOMWindowLeak ([+\-]{2})DOMWINDOW")
 
 
 class ShutdownLeaks(object):
@@ -148,16 +150,17 @@ class ShutdownLeaks(object):
                         ),
                     )
                 )
 
             if test["hiddenWindowsCount"] > 0:
                 # Note: to figure out how many hidden windows were created, we divide
                 # this number by 2, because 1 hidden window creation implies in
                 # 1 outer window + 1 inner window.
+                # pylint --py3k W1619
                 self.logger.info(
                     "TEST-INFO | %s | This test created %d hidden window(s)"
                     % (test["fileName"], test["hiddenWindowsCount"] / 2)
                 )
 
             if test["hiddenDocShellsCount"] > 0:
                 self.logger.info(
                     "TEST-INFO | %s | This test created %d hidden docshell(s)"
--- a/testing/mochitest/pywebsocket3/mod_pywebsocket/stream.py
+++ b/testing/mochitest/pywebsocket3/mod_pywebsocket/stream.py
@@ -28,16 +28,18 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 """This file provides classes and helper functions for parsing/building frames
 of the WebSocket protocol (RFC 6455).
 
 Specification:
 http://tools.ietf.org/html/rfc6455
 """
 
+from __future__ import division
+
 from collections import deque
 import logging
 import os
 import struct
 import time
 import socket
 import six
 
@@ -267,27 +269,29 @@ def parse_frame(receive_bytes,
 
     logger.log(common.LOGLEVEL_FINE, 'Receive payload data')
     if logger.isEnabledFor(common.LOGLEVEL_FINE):
         receive_start = time.time()
 
     raw_payload_bytes = receive_bytes(payload_length)
 
     if logger.isEnabledFor(common.LOGLEVEL_FINE):
+        # pylint --py3k W1619
         logger.log(
             common.LOGLEVEL_FINE, 'Done receiving payload data at %s MB/s',
             payload_length / (time.time() - receive_start) / 1000 / 1000)
     logger.log(common.LOGLEVEL_FINE, 'Unmask payload data')
 
     if logger.isEnabledFor(common.LOGLEVEL_FINE):
         unmask_start = time.time()
 
     unmasked_bytes = masker.mask(raw_payload_bytes)
 
     if logger.isEnabledFor(common.LOGLEVEL_FINE):
+        # pylint --py3k W1619
         logger.log(common.LOGLEVEL_FINE,
                    'Done unmasking payload data at %s MB/s',
                    payload_length / (time.time() - unmask_start) / 1000 / 1000)
 
     return opcode, unmasked_bytes, fin, rsv1, rsv2, rsv3
 
 
 class FragmentedFrameBuilder(object):
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -1,17 +1,17 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 """
 Runs the Mochitest test harness.
 """
 
-from __future__ import print_function, with_statement
+from __future__ import division, print_function, with_statement
 import os
 import sys
 
 SCRIPT_DIR = os.path.abspath(os.path.realpath(os.path.dirname(__file__)))
 sys.path.insert(0, SCRIPT_DIR)
 
 from argparse import Namespace
 from collections import defaultdict
@@ -352,16 +352,17 @@ class MessageLogger(object):
     def dump_buffered(self, limit=False):
         if limit:
             dumped_messages = self.buffered_messages[-self.BUFFERING_THRESHOLD :]
         else:
             dumped_messages = self.buffered_messages
 
         last_timestamp = None
         for buf in dumped_messages:
+            # pylint --py3k W1619
             timestamp = datetime.fromtimestamp(buf["time"] / 1000).strftime("%H:%M:%S")
             if timestamp != last_timestamp:
                 self.logger.info("Buffered messages logged at {}".format(timestamp))
             last_timestamp = timestamp
 
             self.logger.log_raw(buf)
         self.logger.info("Buffered messages finished")
         # Cleaning the list of buffered messages
--- a/testing/mozbase/manifestparser/manifestparser/filters.py
+++ b/testing/mozbase/manifestparser/manifestparser/filters.py
@@ -3,17 +3,17 @@
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
 """
 A filter is a callable that accepts an iterable of test objects and a
 dictionary of values, and returns a new iterable of test objects. It is
 possible to define custom filters if the built-in ones are not enough.
 """
 
-from __future__ import absolute_import
+from __future__ import absolute_import, division
 
 import itertools
 import os
 from collections import defaultdict, MutableSequence
 
 import six
 from six import string_types
 
@@ -357,16 +357,17 @@ class chunk_by_runtime(InstanceFilter):
         return manifest
 
     def get_chunked_manifests(self, manifests):
         # Find runtimes for all relevant manifests.
         runtimes = [(self.runtimes[m], m) for m in manifests if m in self.runtimes]
 
         # Compute the average to use as a default for manifests that don't exist.
         times = [r[0] for r in runtimes]
+        # pylint --py3k W1619
         avg = round(sum(times) / len(times), 2) if times else 0
         missing = sorted([m for m in manifests if m not in self.runtimes])
         log(
             "Applying average runtime of {}s to the following missing manifests:\n{}".format(
                 avg, "  " + "\n  ".join(missing)
             )
         )
         runtimes.extend([(avg, m) for m in missing])
@@ -387,16 +388,17 @@ class chunk_by_runtime(InstanceFilter):
         chunks.sort(key=lambda x: (x[0], len(x[1])))
         return chunks
 
     def __call__(self, tests, values):
         tests = list(tests)
         manifests = set(self.get_manifest(t) for t in tests)
         chunks = self.get_chunked_manifests(manifests)
         runtime, this_manifests = chunks[self.this_chunk - 1]
+        # pylint --py3k W1619
         log(
             "Cumulative test runtime is around {} minutes (average is {} minutes)".format(
                 round(runtime / 60),
                 round(sum([c[0] for c in chunks]) / (60 * len(chunks))),
             )
         )
         return (t for t in tests if self.get_manifest(t) in this_manifests)
 
--- a/testing/mozbase/mozdevice/mozdevice/adb.py
+++ b/testing/mozbase/mozdevice/mozdevice/adb.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 import io
 import os
 import pipes
 import posixpath
 import re
 import shlex
 import shutil
@@ -3396,16 +3396,17 @@ class ADBDevice(ADBCommand):
             if match:
                 parameter = match.group(1)
                 value = match.group(2)
                 if parameter == "level":
                     level = float(value)
                 elif parameter == "scale":
                     scale = float(value)
                 if parameter is not None and scale is not None:
+                    # pylint --py3k W1619
                     percentage = 100.0 * level / scale
                     break
         return percentage
 
     def get_top_activity(self, timeout=None):
         """Returns the name of the top activity (focused app) reported by dumpsys
 
         :param int timeout: The maximum time in
--- a/testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/symbolication.py
+++ b/testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/symbolication.py
@@ -1,12 +1,12 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-from __future__ import absolute_import
+from __future__ import absolute_import, division
 
 import hashlib
 import os
 import platform
 import subprocess
 import six
 import zipfile
 from distutils import spawn
@@ -307,16 +307,17 @@ class ProfileSymbolicator:
                 continue
             for i, s in enumerate(thread["stringTable"]):
                 thread["stringTable"][i] = symbolication_table.get(s, s)
 
     def _get_containing_library(self, address, libs):
         left = 0
         right = len(libs) - 1
         while left <= right:
+            # pylint --py3k W1619
             mid = (left + right) / 2
             if address >= libs[mid]["end"]:
                 left = mid + 1
             elif address < libs[mid]["start"]:
                 right = mid - 1
             else:
                 return libs[mid]
         return None
--- a/testing/mozbase/mozlog/mozlog/formatters/tbplformatter.py
+++ b/testing/mozbase/mozlog/mozlog/formatters/tbplformatter.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import absolute_import
+from __future__ import absolute_import, division
 
 import functools
 from collections import deque
 
 from .base import BaseFormatter
 from .process import strstatus
 from ..handlers import SummaryHandler
 import six
@@ -302,16 +302,17 @@ class TbplFormatter(BaseFormatter):
             sections.append(duration_msg)
         rv.append(" | ".join(sections) + "\n")
         if screenshot_msg:
             rv.append(screenshot_msg[1:] + "\n")
         return "".join(rv)
 
     def suite_end(self, data):
         start_time = self.suite_start_time
+        # pylint --py3k W1619
         time = int((data["time"] - start_time) / 1000)
 
         return "SUITE-END | took %is\n" % time
 
     def test_id(self, test_id):
         if isinstance(test_id, (str, six.text_type)):
             return test_id
         else:
--- a/testing/mozbase/mozlog/mozlog/formatters/unittest.py
+++ b/testing/mozbase/mozlog/mozlog/formatters/unittest.py
@@ -1,15 +1,15 @@
 #!/usr/bin/env python
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 
-from __future__ import absolute_import
+from __future__ import absolute_import, division
 
 from . import base
 
 
 class UnittestFormatter(base.BaseFormatter):
     """Formatter designed to produce output in a format like that used by
     the ``unittest`` module in the standard library."""
 
@@ -73,12 +73,13 @@ class UnittestFormatter(base.BaseFormatt
 
     def output_fails(self):
         return "\n".join("FAIL %(test)s\n%(message)s\n" % data for data in self.fails)
 
     def output_errors(self):
         return "\n".join("ERROR %(test)s\n%(message)s" % data for data in self.errors)
 
     def output_summary(self):
+        # pylint --py3k W1619
         return "Ran %i tests in %.1fs" % (
             self.tests_run,
             (self.end_time - self.start_time) / 1000,
         )
--- a/testing/mozbase/mozpower/mozpower/intel_power_gadget.py
+++ b/testing/mozbase/mozpower/mozpower/intel_power_gadget.py
@@ -1,12 +1,12 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-from __future__ import absolute_import, unicode_literals
+from __future__ import absolute_import, division, unicode_literals
 
 import csv
 import os
 import subprocess
 import re
 import time
 import threading
 
@@ -543,16 +543,17 @@ class IPGResultsHandler(object):
                 "Could not write out cleaned results of %s to %s due to the following error"
                 ", skipping this step: %s" % (file, clean_output_path, str(e))
             )
 
         # Check to make sure the expected number of samples
         # exist in the file and that the columns have the correct
         # data type.
         column_datatypes = {"System Time": str, "RDTSC": int, "default": float}
+        # pylint --py3k W1619
         expected_samples = int(
             self._ipg_measure_duration / (float(self._sampling_rate) / 1000)
         )
         for key in results:
             if len(results[key]) != expected_samples:
                 self._logger.warning(
                     "Unexpected number of samples in %s for column %s - "
                     "expected: %s, got: %s"
@@ -689,16 +690,17 @@ class IPGResultsHandler(object):
         except Exception as e:
             self.merged_output_path = None
             self._logger.warning(
                 "Could not write out merged results to %s due to the following error"
                 ", skipping this step: %s" % (merged_output_path, str(e))
             )
 
         # Check that the combined results have the expected number of samples.
+        # pylint W16919
         expected_samples = int(
             self._ipg_measure_duration / (float(self._sampling_rate) / 1000)
         )
         combined_expected_samples = len(self._cleaned_files) * expected_samples
         for key in combined_results:
             if len(combined_results[key]) != combined_expected_samples:
                 self._logger.warning(
                     "Unexpected number of merged samples in %s for column %s - "
@@ -812,16 +814,17 @@ class IPGResultsHandler(object):
                 cumulative_mwh[replace_measure_name(measure)] = float(
                     cut_results[measure][-1]
                 )
 
         # Get the power usage rate in Watts
         watt_usage = {}
         for measure in cut_results:
             if "watt" in measure.lower() and "limit" not in measure.lower():
+                # pylint --py3k W1619
                 watt_usage[replace_measure_name(measure) + "-avg"] = sum(
                     [float(val) for val in cut_results[measure]]
                 ) / len(cut_results[measure])
                 watt_usage[replace_measure_name(measure) + "-max"] = max(
                     [float(val) for val in cut_results[measure]]
                 )
 
         # Get average CPU and GPU utilization
@@ -834,16 +837,17 @@ class IPGResultsHandler(object):
                 continue
 
             utilized_name = utilization.lower()
             if "cpu " in utilized_name:
                 utilized_name = "cpu"
             elif "gt " in utilized_name:
                 utilized_name = "gpu"
 
+            # pylint --py3k W1619
             average_utilization[utilized_name] = sum(
                 [float(val) for val in cut_results[utilization]]
             ) / len(cut_results[utilization])
 
         # Get average and maximum CPU and GPU frequency
         frequency_info = {"cpu": {}, "gpu": {}}
         for frequency_measure in ("CPU Frequency_0(MHz)", "GT Frequency(MHz)"):
             if frequency_measure not in cut_results:
@@ -852,16 +856,17 @@ class IPGResultsHandler(object):
                 )
                 continue
 
             fmeasure_name = frequency_measure.lower()
             if "cpu " in fmeasure_name:
                 fmeasure_name = "cpu"
             elif "gt " in fmeasure_name:
                 fmeasure_name = "gpu"
+            # pylint --py3k W1619
 
             frequency_info[fmeasure_name]["favg"] = sum(
                 [float(val) for val in cut_results[frequency_measure]]
             ) / len(cut_results[frequency_measure])
 
             frequency_info[fmeasure_name]["fmax"] = max(
                 [float(val) for val in cut_results[frequency_measure]]
             )
--- a/testing/mozbase/mozpower/mozpower/mozpowerutils.py
+++ b/testing/mozbase/mozpower/mozpower/mozpowerutils.py
@@ -1,12 +1,12 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-from __future__ import absolute_import, unicode_literals
+from __future__ import absolute_import, division, unicode_literals
 
 
 def get_logger(logger_name):
     """Returns the logger that should be used based on logger_name.
     Defaults to the logging logger if mozlog cannot be imported.
 
     :returns: mozlog or logging logger object
     """
@@ -27,16 +27,17 @@ def get_logger(logger_name):
 
 
 def average_summary(values):
     """Averages all given values.
 
     :param list values: list of values to average.
     :returns: float
     """
+    # pylint --py3k W1619
     return sum([float(v[0]) for v in values]) / len(values)
 
 
 def sum_summary(values):
     """Adds all values together.
 
     :param list values: list of values to sum.
     :returns: float
--- a/testing/mozbase/mozprofile/tests/test_profile.py
+++ b/testing/mozbase/mozprofile/tests/test_profile.py
@@ -1,15 +1,15 @@
 #!/usr/bin/env python
 
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import absolute_import
+from __future__ import absolute_import, division
 
 import os
 
 import mozunit
 import pytest
 
 from mozprofile.prefs import Preferences
 from mozprofile import (
@@ -30,16 +30,17 @@ def test_with_profile_should_cleanup():
         assert os.path.exists(profile.profile)
 
     # profile is cleaned
     assert not os.path.exists(profile.profile)
 
 
 def test_with_profile_should_cleanup_even_on_exception():
     with pytest.raises(ZeroDivisionError):
+        # pylint --py3k W1619
         with Profile() as profile:
             assert os.path.exists(profile.profile)
             1 / 0  # will raise ZeroDivisionError
 
     # profile is cleaned
     assert not os.path.exists(profile.profile)
 
 
--- a/testing/mozbase/mozrunner/mozrunner/devices/emulator_battery.py
+++ b/testing/mozbase/mozrunner/mozrunner/devices/emulator_battery.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import absolute_import
+from __future__ import absolute_import, division
 
 
 class EmulatorBattery(object):
     def __init__(self, emulator):
         self.emulator = emulator
 
     def get_state(self):
         status = {}
@@ -21,16 +21,17 @@ class EmulatorBattery(object):
                 if value == "true":
                     value = True
                 elif value == "false":
                     value = False
                 elif field == "capacity":
                     value = float(value)
                 status[field] = value
 
+        # pylint --py3k W1619
         state["level"] = status.get("capacity", 0.0) / 100
         if status.get("AC") == "online":
             state["charging"] = True
         else:
             state["charging"] = False
 
         return state
 
--- a/testing/mozbase/mozrunner/mozrunner/utils.py
+++ b/testing/mozbase/mozrunner/mozrunner/utils.py
@@ -1,17 +1,17 @@
 #!/usr/bin/env python
 
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
 """Utility functions for mozrunner"""
 
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 import os
 import sys
 
 import mozinfo
 
 __all__ = ["findInPath", "get_metadata_from_egg"]
 
@@ -165,25 +165,27 @@ def test_environment(
             else:
                 log.error(
                     "TEST-UNEXPECTED-FAIL | runtests.py | Failed to find"
                     " ASan symbolizer at %s" % llvmsym
                 )
 
             # Returns total system memory in kilobytes.
             if mozinfo.isWin:
+                # pylint --py3k W1619
                 totalMemory = (
                     int(
                         os.popen(
                             "wmic computersystem get TotalPhysicalMemory"
                         ).readlines()[1]
                     )
                     / 1024
                 )
             elif mozinfo.isMac:
+                # pylint --py3k W1619
                 totalMemory = (
                     int(os.popen("sysctl hw.memsize").readlines()[0].split()[1]) / 1024
                 )
             else:
                 totalMemory = int(os.popen("free").readlines()[1].split()[1])
 
             # Only 4 GB RAM or less available? Use custom ASan options to reduce
             # the amount of resources required to do the tests. Standard options
--- a/testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py
+++ b/testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import absolute_import
+from __future__ import absolute_import, division
 
 from contextlib import contextmanager
 import multiprocessing
 import sys
 import time
 import warnings
 
 from collections import (
@@ -522,20 +522,22 @@ class SystemResourceMonitor(object):
                 cpu[i].append(v)
 
         samples = len(cpu[0])
 
         if not samples:
             return 0
 
         if per_cpu:
+            # pylint --py3k W1619
             return [sum(x) / samples for x in cpu]
 
         cores = [sum(x) for x in cpu]
 
+        # pylint --py3k W1619
         return sum(cores) / len(cpu) / samples
 
     def aggregate_cpu_times(self, start=None, end=None, phase=None, per_cpu=True):
         """Obtain the aggregate CPU times for a range.
 
         If per_cpu is True (the default), this returns a list of named tuples.
         Each tuple is as if it were returned by psutil.cpu_times(). If per_cpu
         is False, this returns a single named tuple of the aforementioned type.
@@ -667,16 +669,17 @@ class SystemResourceMonitor(object):
             swap_fields=list(self._swap_type._fields),
             samples=[],
             phases=[],
             system={},
         )
 
         def populate_derived(e):
             if e["cpu_percent_cores"]:
+                # pylint --py3k W1619
                 e["cpu_percent_mean"] = sum(e["cpu_percent_cores"]) / len(
                     e["cpu_percent_cores"]
                 )
             else:
                 e["cpu_percent_mean"] = None
 
             if e["cpu_times"]:
                 e["cpu_times_sum"] = [0.0] * self._cpu_times_len
--- a/testing/mozharness/mozharness/base/diskutils.py
+++ b/testing/mozharness/mozharness/base/diskutils.py
@@ -23,16 +23,17 @@
     # convert file_size to GB
     try:
         file_size = convert_to(file_size, from_unit='bytes', to_unit='GB')
     except DiskutilsError as e:
         # manage the exception e.g: log.error(e)
         pass
 
 """
+from __future__ import division
 import ctypes
 import logging
 import os
 import sys
 
 from six import string_types
 
 from mozharness.base.log import INFO, numeric_log_level
@@ -62,16 +63,17 @@ def convert_to(size, from_unit, to_unit)
         "kB": 1024,
         "MB": 1024 * 1024,
         "GB": 1024 * 1024 * 1024,
         "TB": 1024 * 1024 * 1024 * 1024,
     }
     try:
         df = sizes[to_unit]
         sf = sizes[from_unit]
+        # pylint --py3k W1619
         return size * sf / df
     except KeyError:
         raise DiskutilsError("conversion error: Invalid source or destination format")
     except TypeError:
         raise DiskutilsError("conversion error: size (%s) is not a number" % size)
 
 
 class DiskInfo(object):
--- a/testing/mozharness/mozharness/base/python.py
+++ b/testing/mozharness/mozharness/base/python.py
@@ -2,16 +2,17 @@
 # ***** BEGIN LICENSE BLOCK *****
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 # ***** END LICENSE BLOCK *****
 """Python usage, esp. virtualenv.
 """
 
+from __future__ import division
 import errno
 import json
 import os
 import socket
 import sys
 import traceback
 
 try:
@@ -830,16 +831,17 @@ class ResourceMonitoringMixin(Perfherder
                 continue
             cpu_attrs.append(attr)
 
         cpu_total = sum(getattr(cpu_times, attr) for attr in cpu_attrs)
 
         for attr in cpu_attrs:
             value = getattr(cpu_times, attr)
             # cpu_total can be 0.0. Guard against division by 0.
+            # pylint --py3k W1619
             percent = value / cpu_total * 100.0 if cpu_total else 0.0
 
             if percent > 1.00:
                 self._tinderbox_print(
                     "CPU {}<br/>{:,.1f} ({:,.1f}%)".format(attr, value, percent)
                 )
 
         # Swap on Windows isn't reported by psutil.
--- a/testing/mozharness/scripts/release/update-verify-config-creator.py
+++ b/testing/mozharness/scripts/release/update-verify-config-creator.py
@@ -1,12 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import division
 from distutils.version import LooseVersion
 import json
 import math
 import os
 import pprint
 import re
 import sys
 from six.moves.urllib.parse import urljoin
@@ -34,16 +35,17 @@ def is_triangualar(x):
     True
     >>> is_triangualar(4)
     False
     >>> all(is_triangualar(x) for x in [0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105])
     True
     >>> all(not is_triangualar(x) for x in [4, 5, 8, 9, 11, 17, 25, 29, 39, 44, 59, 61, 72, 98, 112])
     True
     """
+    # pylint --py3k W1619
     n = (math.sqrt(8 * x + 1) - 1) / 2
     return n == int(n)
 
 
 class UpdateVerifyConfigCreator(BaseScript):
     config_options = [
         [
             ["--product"],
--- a/testing/raptor/raptor/browsertime/base.py
+++ b/testing/raptor/raptor/browsertime/base.py
@@ -1,15 +1,15 @@
 #!/usr/bin/env python
 
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import absolute_import
+from __future__ import absolute_import, division
 
 from abc import ABCMeta, abstractmethod
 
 import os
 import json
 import re
 import six
 import sys
@@ -317,21 +317,23 @@ class Browsertime(Perftest):
             browsertime_options
             + ["-n", str(test.get("browser_cycles", 1))]
         )
 
     def _compute_process_timeout(self, test, timeout):
         # bt_timeout will be the overall browsertime cmd/session timeout (seconds)
         # browsertime deals with page cycles internally, so we need to give it a timeout
         # value that includes all page cycles
+        # pylint --py3k W1619
         bt_timeout = int(timeout / 1000) * int(test.get("page_cycles", 1))
 
         # the post-startup-delay is a delay after the browser has started, to let it settle
         # it's handled within browsertime itself by loading a 'preUrl' (about:blank) and having a
         # delay after that ('preURLDelay') as the post-startup-delay, so we must add that in sec
+        # pylint --py3k W1619
         bt_timeout += int(self.post_startup_delay / 1000)
 
         # add some time for browser startup, time for the browsertime measurement code
         # to be injected/invoked, and for exceptions to bubble up; be generous
         bt_timeout += 20
 
         # browsertime also handles restarting the browser/running all of the browser cycles;
         # so we need to multiply our bt_timeout by the number of browser cycles
--- a/testing/raptor/raptor/cpu.py
+++ b/testing/raptor/raptor/cpu.py
@@ -1,12 +1,12 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-from __future__ import absolute_import
+from __future__ import absolute_import, division
 
 import time
 import threading
 
 from logger.logger import RaptorLogger
 
 LOG = RaptorLogger(component="raptor-cpu")
 
@@ -127,17 +127,19 @@ class AndroidCPUProfiler(object):
         if len(self.polls) == 0:
             LOG.info("No CPU usage data found, submitting as 0% usage.")
             self.polls.append(0)
 
         avg_cpuinfo_data = {
             u"type": u"cpu",
             u"test": test_name + "-avg",
             u"unit": u"%",
-            u"values": {u"avg": sum(self.polls) / len(self.polls)},
+            u"values": {
+                u"avg": sum(self.polls) / len(self.polls)
+            },  # pylint --py3k W1619
         }
         self.raptor.control_server.submit_supporting_data(avg_cpuinfo_data)
 
         min_cpuinfo_data = {
             u"type": u"cpu",
             u"test": test_name + "-min",
             u"unit": u"%",
             u"values": {u"min": min(self.polls)},
--- a/testing/raptor/raptor/filters.py
+++ b/testing/raptor/raptor/filters.py
@@ -1,15 +1,15 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 # originally taken from /testing/talos/talos/filter.py
 
-from __future__ import absolute_import
+from __future__ import absolute_import, division
 
 import math
 
 """
 data filters:
 takes a series of run data and applies statistical transforms to it
 
 Each filter is a simple function, but it also have attached a special
@@ -115,19 +115,22 @@ def mean(series):
 @define_filter
 def median(series):
     """
     median of data; needs at least one data point
     """
     series = sorted(series)
     if len(series) % 2:
         # odd
-        return series[len(series) / 2]
+        # pylint --py3k W1619
+        # must force to int to use as index.
+        return series[int(len(series) / 2)]
     else:
         # even
+        # pylint --py3k W1619
         middle = int(len(series) / 2)  # the higher of the middle 2, actually
         return 0.5 * (series[middle - 1] + series[middle])
 
 
 @register_filter
 @define_filter
 def variance(series):
     """
@@ -176,16 +179,17 @@ def dromaeo_chunks(series, size):
 @define_filter
 def geometric_mean(series):
     """
     geometric_mean: http://en.wikipedia.org/wiki/Geometric_mean
     """
     total = 0
     for i in series:
         total += math.log(i + 1)
+    # pylint --py3k W1619
     return math.exp(total / len(series)) - 1
 
 
 # filters that return a list
 
 
 @register_filter
 @define_filter
@@ -264,15 +268,16 @@ def v8_subtest(series, name):
         "Boyer": 666463.0,
         "NavierStokes": 1484000.0,
         "RayTrace": 739989.0,
         "RegExp": 910985.0,
         "Richards": 35302.0,
         "Splay": 81491.0,
     }
 
+    # pylint --py3k W1619
     return reference[name] / geometric_mean(series)
 
 
 @register_filter
 @define_filter
 def responsiveness_Metric(val_list):
     return sum([float(x) * float(x) / 1000000.0 for x in val_list])
--- a/testing/raptor/raptor/output.py
+++ b/testing/raptor/raptor/output.py
@@ -1,16 +1,16 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 # some parts of this originally taken from /testing/talos/talos/output.py
 
 """output raptor test results"""
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 import filters
 
 import json
 import os
 
 from abc import ABCMeta, abstractmethod
 from logger.logger import RaptorLogger
@@ -329,16 +329,17 @@ class PerftestOutput(object):
             # and a sum of the 9 values.  We receive 160 values, and want to use
             # the 16 test values, not the sub test values.
             if len(results) != 160:
                 raise Exception(
                     "Speedometer has 160 subtests, found: %s instead" % len(results)
                 )
 
             results = results[9::10]
+            # pylint --py3k W1619
             score = 60 * 1000 / filters.geometric_mean(results) / correctionFactor
             return score
 
         if testname.startswith("raptor-stylebench"):
             # see https://bug-172968-attachments.webkit.org/attachment.cgi?id=319888
             correctionFactor = 3
             results = _filter(vals)
 
@@ -374,16 +375,17 @@ class PerftestOutput(object):
             #
             # We receive 76 entries per test, which ads up to 380. We want to use
             # the 5 test entries, not the rest.
             if len(results) != 380:
                 raise Exception(
                     "StyleBench requires 380 entries, found: %s instead" % len(results)
                 )
             results = results[75::76]
+            # pylint --py3k W1619
             return 60 * 1000 / filters.geometric_mean(results) / correctionFactor
 
         if testname.startswith(("raptor-kraken", "raptor-sunspider")):
             return sum(_filter(vals))
 
         if testname.startswith(("raptor-unity-webgl", "raptor-webaudio")):
             # webaudio_score and unity_webgl_score: self reported as 'Geometric Mean'
             return filters.mean(_filter(vals, "Geometric Mean"))
--- a/testing/raptor/raptor/power.py
+++ b/testing/raptor/raptor/power.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import absolute_import
+from __future__ import absolute_import, division
 
 import os
 import re
 import time
 
 from logger.logger import RaptorLogger
 from mozdevice import ADBError, ADBTimeoutError
 
@@ -353,27 +353,29 @@ def finish_android_power_test(raptor, te
             if not test_time:
                 test_time = float(test_end_time - raptor.test_start_time) / 60
             LOG.info("Approximate power test time %s" % str(test_time))
 
             def calculate_pc(power_measure, baseline_measure):
                 if not baseline_measure:
                     LOG.error("Power test baseline_measure is Zero.")
                     return 0
+                # pylint --py3k W1619
                 return (
                     100 * ((power_measure + baseline_measure) / baseline_measure)
                 ) - 100
 
             pc_power_data = {
                 "type": "power",
                 "test": power_data["test"] + "-%change",
                 "unit": "%",
                 "values": {},
             }
             for power_measure in power_data["values"]:
+                # pylint --py3k W1619
                 pc_power_data["values"][power_measure] = calculate_pc(
                     (power_data["values"][power_measure] / test_time),
                     raptor.os_baseline_data["values"][power_measure],
                 )
 
             raptor.control_server.submit_supporting_data(pc_power_data)
             raptor.control_server.submit_supporting_data(raptor.os_baseline_data)
 
--- a/testing/raptor/raptor/webextension/base.py
+++ b/testing/raptor/raptor/webextension/base.py
@@ -1,15 +1,15 @@
 #!/usr/bin/env python
 
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import absolute_import
+from __future__ import absolute_import, division
 
 import json
 import os
 import requests
 import time
 
 from benchmark import Benchmark
 from cmdline import CHROMIUM_DISTROS
@@ -68,19 +68,21 @@ class WebExtension(Perftest):
 
     def wait_for_test_finish(self, test, timeout, process_exists_callback=None):
         # this is a 'back-stop' i.e. if for some reason Raptor doesn't finish for some
         # serious problem; i.e. the test was unable to send a 'page-timeout' to the control
         # server, etc. Therefore since this is a 'back-stop' we want to be generous here;
         # we don't want this timeout occurring unless abosultely necessary
 
         # convert timeout to seconds and account for page cycles
+        # pylint --py3k W1619
         timeout = int(timeout / 1000) * int(test.get("page_cycles", 1))
         # account for the pause the raptor webext runner takes after browser startup
         # and the time an exception is propagated through the framework
+        # pylint --py3k W1619
         timeout += int(self.post_startup_delay / 1000) + 10
 
         # for page-load tests we don't start the page-timeout timer until the pageload.js content
         # is successfully injected and invoked; which differs per site being tested; therefore we
         # need to be generous here - let's add 10 seconds extra per page-cycle
         if test.get("type") == "pageload":
             timeout += 10 * int(test.get("page_cycles", 1))
 
--- a/testing/raptor/test/test_cpu.py
+++ b/testing/raptor/test/test_cpu.py
@@ -1,12 +1,12 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-from __future__ import absolute_import, unicode_literals
+from __future__ import absolute_import, division, unicode_literals
 
 
 import os
 import sys
 import mock
 import mozunit
 
 # need this so the raptor unit tests can find output & filter classes
@@ -160,16 +160,17 @@ def test_usage_with_fallback():
             raptor.config["cpu_test"] = True
             raptor.control_server = control_server
 
             cpu_profiler = cpu.AndroidCPUProfiler(raptor)
             cpu_profiler.polls.append(cpu_profiler.get_app_cpu_usage())
             cpu_profiler.polls.append(0)
 
             # Verify the response contains our expected CPU % of 8
+            # pylint --py3k W1619
             avg_cpuinfo_data = {
                 "type": "cpu",
                 "test": "usage_with_fallback-avg",
                 "unit": "%",
                 "values": {"avg": 8 / 2},
             }
             min_cpuinfo_data = {
                 "type": "cpu",
--- a/testing/talos/talos/filter.py
+++ b/testing/talos/talos/filter.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import absolute_import
+from __future__ import absolute_import, division
 
 import math
 import six
 
 """
 data filters:
 takes a series of run data and applies statistical transforms to it
 
@@ -175,16 +175,17 @@ def dromaeo_chunks(series, size):
 @define_filter
 def geometric_mean(series):
     """
     geometric_mean: http://en.wikipedia.org/wiki/Geometric_mean
     """
     total = 0
     for i in series:
         total += math.log(i + 1)
+    # pylint --py3k W1619
     return math.exp(total / len(series)) - 1
 
 
 # filters that return a list
 
 
 @register_filter
 @define_filter
@@ -249,15 +250,16 @@ def v8_subtest(series, name):
         "Boyer": 666463.0,
         "NavierStokes": 1484000.0,
         "RayTrace": 739989.0,
         "RegExp": 910985.0,
         "Richards": 35302.0,
         "Splay": 81491.0,
     }
 
+    # pylint --py3k W1619
     return reference[name] / geometric_mean(series)
 
 
 @register_filter
 @define_filter
 def responsiveness_Metric(val_list):
     return sum([float(x) * float(x) / 1000000.0 for x in val_list])
--- a/testing/talos/talos/heavy.py
+++ b/testing/talos/talos/heavy.py
@@ -1,16 +1,16 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 """
 Downloads Heavy profiles from TaskCluster.
 """
-from __future__ import absolute_import
+from __future__ import absolute_import, division
 import os
 import tarfile
 import functools
 import datetime
 from email.utils import parsedate
 
 import requests
 from requests.adapters import HTTPAdapter
@@ -116,16 +116,17 @@ def download_profile(name, profiles_dir=
     req.raise_for_status()
 
     total_length = int(req.headers.get("content-length"))
 
     # XXX implement Range to resume download on disconnects
     template = "Download progress %d%%"
     with open(archive_file, "wb") as f:
         iter = req.iter_content(chunk_size=1024)
+        # pylint --py3k W1619
         size = total_length / 1024 + 1
         with ProgressBar(size=size, template=template) as bar:
             for chunk in iter:
                 if chunk:
                     f.write(chunk)
                 bar.incr()
 
     LOG.info("Extracting profile in %r" % target)
--- a/testing/talos/talos/output.py
+++ b/testing/talos/talos/output.py
@@ -1,14 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 """output formats for Talos"""
-from __future__ import absolute_import
+from __future__ import absolute_import, division
 
 from talos import filter
 
 # NOTE: we have a circular dependency with output.py when we import results
 import simplejson as json
 from talos import utils
 from mozlog import get_proxy_logger
 
@@ -305,16 +305,17 @@ class Output(object):
         # We receive 76 entries per test, which ads up to 380. We want to use
         # the 5 test entries, not the rest.
         if len(results) != 380:
             raise Exception(
                 "StyleBench requires 380 entries, found: %s instead" % len(results)
             )
 
         results = results[75::76]
+        # pylint --py3k W1619
         score = 60 * 1000 / filter.geometric_mean(results) / correctionFactor
         return score
 
     def construct_results(self, vals, testname):
         if "responsiveness" in testname:
             return filter.responsiveness_Metric([val for (val, page) in vals])
         elif testname.startswith("v8_7"):
             return self.v8_Metric(vals)
--- a/testing/talos/talos/scripts/report.py
+++ b/testing/talos/talos/scripts/report.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import absolute_import
+from __future__ import absolute_import, division
 
 import argparse
 import collections
 import csv
 import os
 import six
 import sys
 from calendar import day_name
@@ -72,16 +72,17 @@ def generate_report(tuple_list, filepath
                     days[weekday] = days.get(weekday, []) + [variance]
                 elif mode == "count":
                     days[weekday] = days.get(weekday, []) + [runs]
 
             line = ["-".join(test[3:])]
             for day in day_name:
                 if mode == "variance":
                     # removing top and bottom 10% to reduce outlier influence
+                    # pylint --py3k W1619
                     tenth = len(days[day]) / 10
                     average = numpy.average(sorted(days[day])[tenth : tenth * 9 + 1])
                 elif mode == "count":
                     average = numpy.average(days[day])
                 line.append("%.3f" % average)
                 week_avgs.append(average)
 
             outliers = is_normal(week_avgs)
@@ -111,16 +112,17 @@ def is_normal(y):
             if y[i] > (y[i - 1] * limit) or y[i] > (y[i + 1] * limit):
                 outliers.append(i)
                 continue
             clean_week.append(y[i])
     else:
         clean_week = y
 
     # look at weekends now
+    # pylint --py3k W1619
     avg = sum(clean_week) / len(clean_week)
     for i in six.moves.range(5, 7):
         # look for something outside of the 20% window
         if (y[i] * 1.2) < avg or y[i] > (avg * 1.2):
             outliers.append(i)
     return outliers
 
 
--- a/testing/testinfo.py
+++ b/testing/testinfo.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 import datetime
 import errno
 import json
 import os
 import posixpath
 import re
 import requests
@@ -525,16 +525,17 @@ class TestInfoLongRunningTasks(TestInfo)
 
     def __init__(self, verbose):
         TestInfo.__init__(self, verbose)
 
     def report(self, branches, start, end, threshold_pct, filter_threshold_pct):
         def get_long_running_ratio(record):
             count = record["count"]
             tasks_gt_pct = record["tasks_gt_pct"]
+            # pylint --py3k W1619
             return count / tasks_gt_pct
 
         # Search test durations in ActiveData for long-running tests
         query = {
             "from": "task",
             "format": "list",
             "groupby": ["run.name"],
             "limit": 1000,
@@ -584,16 +585,17 @@ class TestInfoLongRunningTasks(TestInfo)
             filtered.sort(key=get_long_running_ratio)
             if not filtered:
                 print("No long running tasks found.")
             for record in filtered:
                 name = record["run"]["name"]
                 count = record["count"]
                 max_run_time = record["max_run_time"]
                 tasks_gt_pct = record["tasks_gt_pct"]
+                # pylint --py3k W1619
                 print(
                     "%-55s: %d of %d runs (%.1f%%) exceeded %d%% of max-run-time (%d s)"
                     % (
                         name,
                         tasks_gt_pct,
                         count,
                         tasks_gt_pct * 100 / count,
                         threshold_pct,
--- a/testing/tps/tps/testrunner.py
+++ b/testing/tps/tps/testrunner.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 import json
 import yaml
 import os
 import re
 import tempfile
 import time
 import traceback
@@ -206,16 +206,17 @@ class TPSTestRunner(object):
                         profiles[profile].profile, "weave", "logs", f
                     )
                     if os.access(weavelog, os.F_OK):
                         with open(weavelog, "r") as fh:
                             for line in fh:
                                 possible_time = line[0:13]
                                 if len(possible_time) == 13 and possible_time.isdigit():
                                     time_ms = int(possible_time)
+                                    # pylint --py3k W1619
                                     formatted = time.strftime(
                                         "%Y-%m-%d %H:%M:%S",
                                         time.localtime(time_ms / 1000),
                                     )
                                     self.log(
                                         "%s.%03d %s"
                                         % (formatted, time_ms % 1000, line[14:])
                                     )
--- a/testing/xpcshell/mach_commands.py
+++ b/testing/xpcshell/mach_commands.py
@@ -1,15 +1,15 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 # Integrates the xpcshell test runner with mach.
 
-from __future__ import absolute_import, unicode_literals, print_function
+from __future__ import absolute_import, division, print_function, unicode_literals
 
 import errno
 import logging
 import os
 import sys
 
 from mozlog import structured
 
@@ -255,16 +255,17 @@ class MachCommands(MachCommandBase):
                 "level": self._mach_context.settings["test"]["level"],
                 "verbose": True,
             }
             params["log"] = structured.commandline.setup_logging(
                 "XPCShellTests", params, log_defaults, fmt_defaults
             )
 
         if not params["threadCount"]:
+            # pylint --py3k W1619
             params["threadCount"] = int((cpu_count() * 3) / 2)
 
         if conditions.is_android(self) or self.substs.get("MOZ_BUILD_APP") == "b2g":
             from mozrunner.devices.android_device import (
                 verify_android_device,
                 get_adb_path,
             )
 
--- a/testing/xpcshell/runxpcshelltests.py
+++ b/testing/xpcshell/runxpcshelltests.py
@@ -1,15 +1,15 @@
 #!/usr/bin/env python
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 import copy
 import json
 import mozdebug
 import os
 import pipes
 import random
 import re
@@ -1651,16 +1651,17 @@ class XPCShellTests(object):
 
         if (
             "tsan" in self.mozInfo
             and self.mozInfo["tsan"]
             and not options.get("threadCount")
         ):
             # TSan requires significantly more memory, so reduce the amount of parallel
             # tests we run to avoid OOMs and timeouts.
+            # pylint --py3k W1619
             self.threadCount = self.threadCount / 2
 
         self.stack_fixer_function = None
         if self.utility_path and os.path.exists(self.utility_path):
             self.stack_fixer_function = get_stack_fixer_function(
                 self.utility_path, self.symbolsPath
             )