diff --git a/testing/mochitest/bisection.py b/testing/mochitest/bisection.py index c9647f1e6a4f..f3847bd5171f 100644 --- a/testing/mochitest/bisection.py +++ b/testing/mochitest/bisection.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, print_function - import math import mozinfo @@ -277,6 +275,6 @@ class Bisect(object): def print_summary(self): "This method is used to print the recorded summary." - print("Bisection summary:") + print "Bisection summary:" for line in self.summary: - print(line) + print line diff --git a/testing/mochitest/leaks.py b/testing/mochitest/leaks.py index b0a95d7dd5f7..479b4c7d6723 100644 --- a/testing/mochitest/leaks.py +++ b/testing/mochitest/leaks.py @@ -5,8 +5,6 @@ # The content of this file comes orginally from automationutils.py # and *should* be revised. -from __future__ import absolute_import, print_function - import re from operator import itemgetter diff --git a/testing/mochitest/mach_commands.py b/testing/mochitest/mach_commands.py index eca75e3665b2..e2462dec5887 100644 --- a/testing/mochitest/mach_commands.py +++ b/testing/mochitest/mach_commands.py @@ -2,7 +2,7 @@ # 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, unicode_literals +from __future__ import absolute_import, unicode_literals from argparse import Namespace from collections import defaultdict diff --git a/testing/mochitest/mach_test_package_commands.py b/testing/mochitest/mach_test_package_commands.py index 65c63b3cf75c..6e5f2749ac39 100644 --- a/testing/mochitest/mach_test_package_commands.py +++ b/testing/mochitest/mach_test_package_commands.py @@ -2,7 +2,7 @@ # 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 unicode_literals import os from argparse import Namespace diff --git a/testing/mochitest/mochitest_options.py b/testing/mochitest/mochitest_options.py index ebdc422a5055..66a720c9d3c4 100644 --- a/testing/mochitest/mochitest_options.py +++ b/testing/mochitest/mochitest_options.py @@ -2,8 +2,6 @@ # 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 abc import ABCMeta, abstractmethod, abstractproperty from argparse import ArgumentParser, SUPPRESS from distutils.util import strtobool diff --git a/testing/mochitest/pywebsocket_wrapper.py b/testing/mochitest/pywebsocket_wrapper.py index 097baa1d6f26..59c4a97b27dc 100644 --- a/testing/mochitest/pywebsocket_wrapper.py +++ b/testing/mochitest/pywebsocket_wrapper.py @@ -9,8 +9,6 @@ SIGINT. """ -from __future__ import absolute_import - import signal import sys diff --git a/testing/mochitest/rungeckoview.py b/testing/mochitest/rungeckoview.py index 29bd35520eaf..18762c80b974 100644 --- a/testing/mochitest/rungeckoview.py +++ b/testing/mochitest/rungeckoview.py @@ -2,7 +2,6 @@ # 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 import posixpath import shutil @@ -193,8 +192,8 @@ class GeckoviewTestRunner: # minidumps directory is automatically created when the app # (first) starts, so its lack of presence is a hint that # something went wrong. - print("Automation Error: No crash directory (%s) found on remote device" % - remote_dir) + print "Automation Error: No crash directory (%s) found on remote device" % \ + remote_dir # Whilst no crash was found, the run should still display as a failure return True self.dm.getDirectory(remote_dir, dump_dir) diff --git a/testing/mochitest/runrobocop.py b/testing/mochitest/runrobocop.py index 2a735dc6abeb..8b913247e193 100644 --- a/testing/mochitest/runrobocop.py +++ b/testing/mochitest/runrobocop.py @@ -2,8 +2,6 @@ # 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 - import json import os import sys @@ -532,9 +530,9 @@ class RobocopTestRunner(MochitestDesktop): "No tests run. Did you pass an invalid TEST_PATH?") worstTestResult = 1 else: - print("INFO | runtests.py | Test summary: start.") + print "INFO | runtests.py | Test summary: start." logResult = self.logTestSummary() - print("INFO | runtests.py | Test summary: end.") + print "INFO | runtests.py | Test summary: end." if worstTestResult == 0: worstTestResult = logResult return worstTestResult diff --git a/testing/mochitest/runtests.py b/testing/mochitest/runtests.py index 309bfb3d80a2..458260874a02 100644 --- a/testing/mochitest/runtests.py +++ b/testing/mochitest/runtests.py @@ -6,8 +6,7 @@ Runs the Mochitest test harness. """ -from __future__ import absolute_import, print_function, with_statement - +from __future__ import with_statement import os import sys SCRIPT_DIR = os.path.abspath(os.path.realpath(os.path.dirname(__file__))) diff --git a/testing/mochitest/runtestsremote.py b/testing/mochitest/runtestsremote.py index 060e15994d40..acbf895fa594 100644 --- a/testing/mochitest/runtestsremote.py +++ b/testing/mochitest/runtestsremote.py @@ -2,8 +2,6 @@ # 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 - import os import sys import traceback diff --git a/testing/mochitest/tests/python/conftest.py b/testing/mochitest/tests/python/conftest.py index 8bc8b51731e2..6c75d51c9870 100644 --- a/testing/mochitest/tests/python/conftest.py +++ b/testing/mochitest/tests/python/conftest.py @@ -2,7 +2,7 @@ # 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, unicode_literals +from __future__ import print_function, unicode_literals import json import os from argparse import Namespace diff --git a/testing/mochitest/tests/python/test_basic_mochitest_plain.py b/testing/mochitest/tests/python/test_basic_mochitest_plain.py index 36866170be81..858c155c1ed9 100644 --- a/testing/mochitest/tests/python/test_basic_mochitest_plain.py +++ b/testing/mochitest/tests/python/test_basic_mochitest_plain.py @@ -2,8 +2,6 @@ # 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 - import os from functools import partial diff --git a/testing/mochitest/tests/python/test_get_active_tests.py b/testing/mochitest/tests/python/test_get_active_tests.py index e0cbf9009d39..501e94f7948d 100644 --- a/testing/mochitest/tests/python/test_get_active_tests.py +++ b/testing/mochitest/tests/python/test_get_active_tests.py @@ -2,7 +2,7 @@ # 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, unicode_literals +from __future__ import print_function, unicode_literals import os from argparse import Namespace diff --git a/tools/lint/py2.yml b/tools/lint/py2.yml index a2dd6344d0d3..b47d1266395c 100644 --- a/tools/lint/py2.yml +++ b/tools/lint/py2.yml @@ -41,7 +41,7 @@ py2: - testing/gtest - testing/instrumentation/runinstrumentation.py - testing/marionette - - testing/mochitest/pywebsocket + - testing/mochitest - testing/mozbase - testing/mozharness - testing/remotecppunittests.py diff --git a/tools/lint/py3.yml b/tools/lint/py3.yml index c5b271355b33..7a50fd56a043 100644 --- a/tools/lint/py3.yml +++ b/tools/lint/py3.yml @@ -32,7 +32,7 @@ py3: - testing/firefox-ui/harness/firefox_ui_harness/runners/update.py - testing/gtest - testing/marionette - - testing/mochitest/pywebsocket + - testing/mochitest - testing/mozbase - testing/mozharness - testing/tools/iceserver