Bug 1407763 - Fixed a part of lint errors, not finished yet r?whimboo draft
authorMike Yusko <freshjelly12@yahoo.com>
Thu, 07 Dec 2017 15:03:37 +0200
changeset 709012 bc03a7150de3c23743227186d62b4ed6b9f35607
parent 709008 0e90ecca2248cd0e8994fb7f6d871a0983d0655c
child 709035 ea0f3f5ab9df9c5117d6b815fa80aff5d45c2349
push id92511
push userbmo:freshjelly12@yahoo.com
push dateThu, 07 Dec 2017 13:05:14 +0000
reviewerswhimboo
bugs1407763
milestone59.0a1
Bug 1407763 - Fixed a part of lint errors, not finished yet r?whimboo MozReview-Commit-ID: LokPtceMpJG
testing/marionette/harness/marionette_harness/tests/unit/test_cookies.py
testing/marionette/harness/marionette_harness/tests/unit/test_crash.py
testing/marionette/harness/marionette_harness/tests/unit/test_data_driven.py
testing/marionette/harness/marionette_harness/tests/unit/test_date_time_value.py
testing/marionette/harness/marionette_harness/tests/unit/test_element_retrieval.py
testing/marionette/harness/marionette_harness/tests/unit/test_element_state.py
testing/marionette/harness/marionette_harness/tests/unit/test_element_state_chrome.py
testing/marionette/harness/marionette_harness/tests/unit/test_elementsize.py
testing/marionette/harness/marionette_harness/tests/unit/test_elementsize_chrome.py
testing/marionette/harness/marionette_harness/tests/unit/test_errors.py
testing/marionette/harness/marionette_harness/tests/unit/test_execute_async_script.py
testing/marionette/harness/marionette_harness/tests/unit/test_execute_isolate.py
testing/marionette/harness/marionette_harness/tests/unit/test_execute_script.py
testing/marionette/harness/marionette_harness/tests/unit/test_expectedfail.py
testing/marionette/harness/marionette_harness/tests/unit/test_findelement_chrome.py
testing/marionette/harness/marionette_harness/tests/unit/test_get_current_url_chrome.py
testing/marionette/harness/marionette_harness/tests/unit/test_implicit_waits.py
testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py
testing/marionette/harness/marionette_harness/tests/unit/test_modal_dialogs.py
testing/marionette/harness/marionette_harness/tests/unit/test_mouse_action.py
testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py
testing/marionette/harness/marionette_harness/tests/unit/test_pagesource.py
testing/marionette/harness/marionette_harness/tests/unit/test_pagesource_chrome.py
testing/marionette/harness/marionette_harness/tests/unit/test_position.py
testing/marionette/harness/marionette_harness/tests/unit/test_prefs.py
testing/marionette/harness/marionette_harness/tests/unit/test_profile_management.py
testing/marionette/harness/marionette_harness/tests/unit/test_proxy.py
testing/marionette/harness/marionette_harness/tests/unit/test_quit_restart.py
testing/marionette/harness/marionette_harness/tests/unit/test_rendered_element.py
testing/marionette/harness/marionette_harness/tests/unit/test_report.py
testing/marionette/harness/marionette_harness/tests/unit/test_run_js_test.py
testing/marionette/harness/marionette_harness/tests/unit/test_screen_orientation.py
testing/marionette/harness/marionette_harness/tests/unit/test_screenshot.py
testing/marionette/harness/marionette_harness/tests/unit/test_select.py
testing/marionette/harness/marionette_harness/tests/unit/test_session.py
testing/marionette/harness/marionette_harness/tests/unit/test_shadow_dom.py
testing/marionette/harness/marionette_harness/tests/unit/test_single_finger_desktop.py
testing/marionette/harness/marionette_harness/tests/unit/test_skip_setup.py
testing/marionette/harness/marionette_harness/tests/unit/test_switch_frame.py
testing/marionette/harness/marionette_harness/tests/unit/test_switch_frame_chrome.py
testing/marionette/harness/marionette_harness/tests/unit/test_switch_window_chrome.py
testing/marionette/harness/marionette_harness/tests/unit/test_switch_window_content.py
testing/marionette/harness/marionette_harness/tests/unit/test_teardown_context_preserved.py
testing/marionette/harness/marionette_harness/tests/unit/test_text.py
testing/marionette/harness/marionette_harness/tests/unit/test_text_chrome.py
testing/marionette/harness/marionette_harness/tests/unit/test_timeouts.py
testing/marionette/harness/marionette_harness/tests/unit/test_title.py
testing/marionette/harness/marionette_harness/tests/unit/test_title_chrome.py
testing/marionette/harness/marionette_harness/tests/unit/test_transport.py
testing/marionette/harness/marionette_harness/tests/unit/test_typing.py
testing/marionette/harness/marionette_harness/tests/unit/test_visibility.py
testing/marionette/harness/marionette_harness/tests/unit/test_wait.py
testing/marionette/harness/marionette_harness/tests/unit/test_window_close_chrome.py
testing/marionette/harness/marionette_harness/tests/unit/test_window_close_content.py
testing/marionette/harness/marionette_harness/tests/unit/test_window_fullscreen.py
testing/marionette/harness/marionette_harness/tests/unit/test_window_handles_chrome.py
testing/marionette/harness/marionette_harness/tests/unit/test_window_handles_content.py
testing/marionette/harness/marionette_harness/tests/unit/test_window_management.py
testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py
testing/marionette/harness/marionette_harness/tests/unit/test_window_minimize.py
testing/marionette/harness/marionette_harness/tests/unit/test_window_rect.py
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_cookies.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_cookies.py
@@ -1,12 +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/.
 
+from __future__ import (
+    absolute_import, 
+    print_function
+)
+
 import calendar
 import random
 import time
 
 from marionette_driver.errors import UnsupportedOperationException
 from marionette_harness import MarionetteTestCase
 
 
@@ -46,17 +51,17 @@ class CookieTest(MarionetteTestCase):
             self.assertRaises(UnsupportedOperationException,
                               self.marionette.delete_all_cookies)
             self.assertRaises(UnsupportedOperationException,
                               self.marionette.get_cookies)
 
     def test_delete_all_cookie(self):
         self.marionette.add_cookie(self.COOKIE_A)
         cookie_returned = str(self.marionette.execute_script("return document.cookie"))
-        print cookie_returned
+        print(cookie_returned)
         self.assertTrue(self.COOKIE_A["name"] in cookie_returned)
         self.marionette.delete_all_cookies()
         self.assertFalse(self.marionette.get_cookies())
 
     def test_delete_cookie(self):
         self.marionette.add_cookie(self.COOKIE_A)
         cookie_returned = str(self.marionette.execute_script("return document.cookie"))
         self.assertTrue(self.COOKIE_A["name"] in cookie_returned)
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_crash.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_crash.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 import glob
 import shutil
 
 from marionette_driver import Wait
 from marionette_driver.errors import (
     MarionetteException,
     NoSuchWindowException,
     TimeoutException
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_data_driven.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_data_driven.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_harness.marionette_test import (
     parameterized,
     with_parameters,
     MetaParameterized,
     MarionetteTestCase
 )
 
 class Parameterizable(object):
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_date_time_value.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_date_time_value.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from datetime import datetime
 
 from marionette_driver.by import By
 from marionette_driver.date_time_value import DateTimeValue
 from marionette_harness import MarionetteTestCase
 
 
 class TestDateTime(MarionetteTestCase):
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_element_retrieval.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_element_retrieval.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 import re
 import urllib
 
 from marionette_driver.by import By
 from marionette_driver.errors import NoSuchElementException, InvalidSelectorException
 from marionette_driver.marionette import HTMLElement
 
 from marionette_harness import MarionetteTestCase, skip
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_element_state.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_element_state.py
@@ -1,12 +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/.
 
+from __future__ import (
+    absolute_import, 
+    print_function
+)
+
 import types
 import urllib
 
 from marionette_driver.by import By
 
 from marionette_harness import MarionetteTestCase
 
 
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_element_state_chrome.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_element_state_chrome.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_driver.by import By
 
 from marionette_harness import MarionetteTestCase, skip, WindowManagerMixin
 
 
 class TestElementState(WindowManagerMixin, MarionetteTestCase):
 
     def setUp(self):
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_elementsize.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_elementsize.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_driver.by import By
 
 from marionette_harness import MarionetteTestCase
 
 
 class TestElementSize(MarionetteTestCase):
     def testShouldReturnTheSizeOfALink(self):
         test_html = self.marionette.absolute_url("testSize.html")
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_elementsize_chrome.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_elementsize_chrome.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_driver.by import By
 
 from marionette_harness import MarionetteTestCase, WindowManagerMixin
 
 
 class TestElementSizeChrome(WindowManagerMixin, MarionetteTestCase):
 
     def setUp(self):
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_errors.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_errors.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 import sys
 
 from marionette_driver import errors
 
 from marionette_harness import marionette_test
 
 
 def fake_cause():
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_execute_async_script.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_execute_async_script.py
@@ -1,8 +1,10 @@
+from __future__ import absolute_import
+
 from marionette_driver.errors import (
     JavascriptException,
     ScriptTimeoutException,
 )
 
 from marionette_harness import MarionetteTestCase
 
 
@@ -55,17 +57,17 @@ class TestExecuteAsyncContent(Marionette
 
     def test_execute_js_exception(self):
         try:
             self.marionette.execute_async_script("""
                 let a = 1;
                 foo(bar);
                 """)
             self.assertFalse(True)
-        except JavascriptException, inst:
+        except JavascriptException as inst:
             self.assertTrue('foo(bar)' in inst.stacktrace)
 
     def test_execute_async_js_exception(self):
         self.assertRaises(JavascriptException,
             self.marionette.execute_async_script, """
             var callback = arguments[arguments.length - 1];
             callback(foo());
             """)
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_execute_isolate.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_execute_isolate.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_driver.errors import ScriptTimeoutException
 
 from marionette_harness import MarionetteTestCase
 
 
 class TestExecuteIsolationContent(MarionetteTestCase):
     def setUp(self):
         super(TestExecuteIsolationContent, self).setUp()
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_execute_script.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_execute_script.py
@@ -1,8 +1,10 @@
+from __future__ import absolute_import
+
 import os
 import urllib
 
 from marionette_driver import By, errors
 from marionette_driver.marionette import Alert, HTMLElement
 from marionette_driver.wait import Wait
 
 from marionette_harness import MarionetteTestCase, skip_if_mobile, WindowManagerMixin
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_expectedfail.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_expectedfail.py
@@ -1,11 +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 marionette_harness import MarionetteTestCase
 
 
 class TestFail(MarionetteTestCase):
     def test_fails(self):
         # this test is supposed to fail!
         self.assertEquals(True, False)
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_findelement_chrome.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_findelement_chrome.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_driver.by import By
 from marionette_driver.errors import NoSuchElementException
 from marionette_driver.marionette import HTMLElement
 
 from marionette_harness import MarionetteTestCase, WindowManagerMixin
 
 
 class TestElementsChrome(WindowManagerMixin, MarionetteTestCase):
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_get_current_url_chrome.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_get_current_url_chrome.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_driver.errors import NoSuchWindowException
 
 from marionette_harness import MarionetteTestCase, WindowManagerMixin, skip_if_mobile
 
 
 class TestGetCurrentUrlChrome(WindowManagerMixin, MarionetteTestCase):
 
     def setUp(self):
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_implicit_waits.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_implicit_waits.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_driver.by import By
 from marionette_driver.errors import NoSuchElementException
 
 from marionette_harness import MarionetteTestCase
 
 
 class TestImplicitWaits(MarionetteTestCase):
     def test_implicitly_wait_for_single_element(self):
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 import socket
 import time
 
 from marionette_driver import errors
 from marionette_driver.marionette import Marionette
 from marionette_harness import MarionetteTestCase, run_if_manage_instance, skip_if_mobile
 
 
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_modal_dialogs.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_modal_dialogs.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_driver.by import By
 from marionette_driver.expected import element_present
 from marionette_driver import errors
 from marionette_driver.marionette import Alert
 from marionette_driver.wait import Wait
 
 from marionette_harness import MarionetteTestCase, WindowManagerMixin
 
--- 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,12 +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/.
 
+from __future__ import absolute_import
+
 import urllib
 
 from marionette_driver.by import By
 from marionette_driver.keys import Keys
 from marionette_driver.marionette import Actions
 
 from marionette_harness import MarionetteTestCase
 
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py
@@ -1,12 +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/.
 
+from __future__ import (
+    absolute_import, 
+    print_function
+)
+
 import contextlib
 import os
 import urllib
 
 from marionette_driver import By, errors, expected, Wait
 from marionette_driver.keys import Keys
 from marionette_harness import (
     MarionetteTestCase,
@@ -700,26 +705,26 @@ class TestTLSNavigation(MarionetteTestCa
         self.marionette.navigate(
             inline("<a href=%s>https is the future</a>" % link_url))
         self.marionette.find_element(By.TAG_NAME, "a").click()
         self.assertIn("https", self.marionette.get_url())
 
     def test_deactivation(self):
         invalid_cert_url = self.test_page_insecure
 
-        print "with safe session"
+        print("with safe session")
         with self.safe_session() as session:
             with self.assertRaises(errors.InsecureCertificateException):
                 session.navigate(invalid_cert_url)
 
-        print "with unsafe session"
+        print("with unsafe session")
         with self.unsafe_session() as session:
             session.navigate(invalid_cert_url)
 
-        print "with safe session again"
+        print("with safe session again")
         with self.safe_session() as session:
             with self.assertRaises(errors.InsecureCertificateException):
                 session.navigate(invalid_cert_url)
 
 
 class TestPageLoadStrategy(BaseNavigationTestCase):
 
     def tearDown(self):
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_pagesource.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_pagesource.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_harness import MarionetteTestCase
 
 
 class TestPageSource(MarionetteTestCase):
     def testShouldReturnTheSourceOfAPage(self):
         test_html = self.marionette.absolute_url("testPageSource.html")
         self.marionette.navigate(test_html)
         source = self.marionette.page_source
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_pagesource_chrome.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_pagesource_chrome.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_harness import MarionetteTestCase, WindowManagerMixin
 
 
 class TestPageSourceChrome(WindowManagerMixin, MarionetteTestCase):
 
     def setUp(self):
         super(TestPageSourceChrome, self).setUp()
         self.marionette.set_context("chrome")
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_position.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_position.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_driver.by import By
 
 from marionette_harness import MarionetteTestCase
 
 
 class TestPosition(MarionetteTestCase):
 
     def test_should_get_element_position_back(self):
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_prefs.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_prefs.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_driver.errors import JavascriptException
 
 from marionette_harness import MarionetteTestCase
 
 
 class TestPreferences(MarionetteTestCase):
     prefs = {
         "bool": "marionette.test.bool",
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_profile_management.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_profile_management.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_harness import MarionetteTestCase
 
 
 class TestProfileManagement(MarionetteTestCase):
 
     def setUp(self):
         MarionetteTestCase.setUp(self)
         self.marionette.enforce_gecko_prefs(
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_proxy.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_proxy.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_driver import errors
 
 from marionette_harness import MarionetteTestCase
 
 
 class TestProxyCapabilities(MarionetteTestCase):
 
     def setUp(self):
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_quit_restart.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_quit_restart.py
@@ -1,12 +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/.
 
+from __future__ import (
+    absolute_import, 
+    print_function
+)
+
 import unittest
 
 from marionette_driver import errors
 
 from marionette_harness import MarionetteTestCase, skip
 
 
 class TestServerQuitApplication(MarionetteTestCase):
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_rendered_element.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_rendered_element.py
@@ -1,8 +1,10 @@
+from __future__ import absolute_import
+
 import urllib
 
 from marionette_driver.by import By
 from marionette_harness import MarionetteTestCase
 
 
 def inline(doc):
     return "data:text/html;charset=utf-8,{}".format(urllib.quote(doc))
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_report.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_report.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_harness import MarionetteTestCase, expectedFailure, skip
 
 
 class TestReport(MarionetteTestCase):
 
     def test_pass(self):
         assert True
 
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_run_js_test.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_run_js_test.py
@@ -1,10 +1,12 @@
 # Any copyright is dedicated to the Public Domain.
 # http://creativecommons.org/publicdomain/zero/1.0/
 
+from __future__ import absolute_import
+
 from marionette_harness import MarionetteTestCase
 
 
 class TestRunJSTest(MarionetteTestCase):
     def test_basic(self):
         self.run_js_test('test_simpletest_pass.js')
         self.run_js_test('test_simpletest_fail.js')
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_screen_orientation.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_screen_orientation.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_driver import errors
 from mozrunner.devices.emulator_screen import EmulatorScreen
 
 from marionette_harness import MarionetteTestCase, skip_if_desktop, skip_if_mobile
 
 
 default_orientation = "portrait-primary"
 unknown_orientation = "Unknown screen orientation: {}"
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_screenshot.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_screenshot.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 import base64
 import hashlib
 import imghdr
 import struct
 import urllib
 
 from marionette_driver import By
 from marionette_driver.errors import NoSuchElementException, NoSuchWindowException
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_select.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_select.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 import urllib
 
 from marionette_driver.by import By
 
 from marionette_harness import MarionetteTestCase
 
 
 def inline(doc):
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_session.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_session.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_driver import errors
 
 from marionette_harness import MarionetteTestCase
 
 
 class TestSession(MarionetteTestCase):
     def setUp(self):
         super(TestSession, self).setUp()
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_shadow_dom.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_shadow_dom.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_driver.by import By
 from marionette_driver.errors import (
     NoSuchElementException,
     StaleElementException,
     UnsupportedOperationException,
 )
 
 from marionette_harness import MarionetteTestCase
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_single_finger_desktop.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_single_finger_desktop.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 import os
 import sys
 
 from marionette_driver.errors import MarionetteException
 from marionette_driver import Actions, By
 
 from marionette_harness import MarionetteTestCase, skip
 
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_skip_setup.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_skip_setup.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_harness import MarionetteTestCase, SkipTest
 
 
 class TestSetUpSkipped(MarionetteTestCase):
 
     testVar = {'test':'SkipTest'}
 
     def setUp(self):
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_switch_frame.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_switch_frame.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_driver.by import By
 from marionette_driver.errors import (
     JavascriptException,
     NoSuchFrameException,
 )
 
 from marionette_harness import MarionetteTestCase
 
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_switch_frame_chrome.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_switch_frame_chrome.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_driver.errors import JavascriptException
 
 from marionette_harness import MarionetteTestCase, WindowManagerMixin
 
 
 class TestSwitchFrameChrome(WindowManagerMixin, MarionetteTestCase):
 
     def setUp(self):
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_switch_window_chrome.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_switch_window_chrome.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 import os
 import sys
 from unittest import skipIf
 
 from marionette_driver import By
 
 # add this directory to the path
 sys.path.append(os.path.dirname(__file__))
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_switch_window_content.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_switch_window_content.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla ublic
 # 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 marionette_driver import Actions, By, Wait
 from marionette_driver.keys import Keys
 
 from marionette_harness import MarionetteTestCase, skip_if_mobile, WindowManagerMixin
 
 
 class TestSwitchToWindowContent(WindowManagerMixin, MarionetteTestCase):
 
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_teardown_context_preserved.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_teardown_context_preserved.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_harness import MarionetteTestCase, SkipTest
 
 
 class TestTearDownContext(MarionetteTestCase):
     def setUp(self):
         MarionetteTestCase.setUp(self)
         self.marionette.set_context(self.marionette.CONTEXT_CHROME)
 
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_text.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_text.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_driver.by import By
 from marionette_harness import MarionetteTestCase
 
 
 class TestText(MarionetteTestCase):
 
     def test_get_text(self):
         test_html = self.marionette.absolute_url("test.html")
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_text_chrome.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_text_chrome.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_driver.by import By
 
 from marionette_harness import MarionetteTestCase, skip, WindowManagerMixin
 
 
 @skip("Disabled in bug 896043 and when working on Chrome code re-enable for bug 896046")
 class TestTextChrome(WindowManagerMixin, MarionetteTestCase):
 
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_timeouts.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_timeouts.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_driver.by import By
 from marionette_driver.errors import (
     MarionetteException,
     NoSuchElementException,
     ScriptTimeoutException,
 )
 from marionette_driver.marionette import HTMLElement
 
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_title.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_title.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 import urllib
 
 from marionette_driver.by import By
 from marionette_harness import MarionetteTestCase, skip
 
 
 def inline(doc):
     return "data:text/html;charset=utf-8,{}".format(urllib.quote(doc))
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_title_chrome.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_title_chrome.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_harness import MarionetteTestCase, WindowManagerMixin
 
 
 class TestTitleChrome(WindowManagerMixin, MarionetteTestCase):
 
     def setUp(self):
         super(TestTitleChrome, self).setUp()
 
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_transport.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_transport.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 import json
 
 from marionette_driver.transport import (
     Command,
     Proto2Command,
     Proto2Response,
     Response,
 )
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_typing.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_typing.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 import urllib
 
 from marionette_driver.by import By
 from marionette_driver.errors import ElementNotInteractableException
 from marionette_driver.keys import Keys
 
 from marionette_harness import MarionetteTestCase, skip, skip_if_mobile
 
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_visibility.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_visibility.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_driver.by import By
 
 from marionette_harness import MarionetteTestCase
 
 
 class TestVisibility(MarionetteTestCase):
 
     def testShouldAllowTheUserToTellIfAnElementIsDisplayedOrNot(self):
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_wait.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_wait.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 import sys
 import time
 
 from marionette_driver import errors, wait
 from marionette_driver.wait import Wait
 
 from marionette_harness import MarionetteTestCase
 
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_window_close_chrome.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_window_close_chrome.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_harness import MarionetteTestCase, WindowManagerMixin
 
 
 class TestCloseWindow(WindowManagerMixin, MarionetteTestCase):
 
     def setUp(self):
         super(TestCloseWindow, self).setUp()
 
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_window_close_content.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_window_close_content.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_harness import MarionetteTestCase, skip_if_mobile, WindowManagerMixin
 
 
 class TestCloseWindow(WindowManagerMixin, MarionetteTestCase):
 
     def tearDown(self):
         self.close_all_windows()
         self.close_all_tabs()
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_window_fullscreen.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_window_fullscreen.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_harness import MarionetteTestCase
 
 
 class TestWindowFullscreen(MarionetteTestCase):
 
     def setUp(self):
         MarionetteTestCase.setUp(self)
         self.max = self.marionette.execute_script("""
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_window_handles_chrome.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_window_handles_chrome.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 import types
 
 from marionette_driver import By, errors, Wait
 
 from marionette_harness import MarionetteTestCase, WindowManagerMixin
 
 
 class TestWindowHandles(WindowManagerMixin, MarionetteTestCase):
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_window_handles_content.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_window_handles_content.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 import types
 
 from marionette_driver import By, errors, Wait
 
 from marionette_harness import MarionetteTestCase, skip_if_mobile, WindowManagerMixin
 
 
 class TestWindowHandles(WindowManagerMixin, MarionetteTestCase):
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_window_management.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_window_management.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_driver import By
 from marionette_driver.errors import NoSuchWindowException
 
 from marionette_harness import MarionetteTestCase, WindowManagerMixin, skip_if_mobile
 
 
 class TestNoSuchWindowContent(WindowManagerMixin, MarionetteTestCase):
 
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_harness import MarionetteTestCase
 
 
 class TestWindowMaximize(MarionetteTestCase):
 
     def setUp(self):
         MarionetteTestCase.setUp(self)
         self.max = self.marionette.execute_script("""
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_window_minimize.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_window_minimize.py
@@ -1,12 +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/.
 
+from __future__ import absolute_import
+
 from marionette_driver.errors import InvalidArgumentException
 
 from marionette_harness import MarionetteTestCase
 
 class TestWindowMinimize(MarionetteTestCase):
 
     def setUp(self):
         MarionetteTestCase.setUp(self)
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_window_rect.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_window_rect.py
@@ -1,12 +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/.
 
+from __future__ import (
+    absolute_import, 
+    print_function
+)
+
 from marionette_driver.errors import InvalidArgumentException
 
 from marionette_harness import MarionetteTestCase
 
 
 class TestPosition(MarionetteTestCase):
 
     def setUp(self):