[tbb-commits] [tor-browser-bundle-testsuite/master] Cleanup tests python imports

gk at torproject.org gk at torproject.org
Thu Oct 15 18:41:27 UTC 2020


commit 71bce1264f10e8f184095aad54cf27e81f56a7a4
Author: Alex Catarineu <acat at torproject.org>
Date:   Mon Sep 14 18:16:10 2020 +0200

    Cleanup tests python imports
---
 marionette/tor_browser_tests/test_acid3.py                    |  6 +-----
 marionette/tor_browser_tests/test_check.py                    |  3 ---
 .../tor_browser_tests/test_dom-objects-enumeration-worker.py  |  1 -
 marionette/tor_browser_tests/test_dom-objects-enumeration.py  |  4 ----
 marionette/tor_browser_tests/test_download_pdf.py             |  2 --
 marionette/tor_browser_tests/test_fp_navigator.py             |  4 ----
 marionette/tor_browser_tests/test_fp_plugins.py               |  3 ---
 marionette/tor_browser_tests/test_fp_screen_coords.py         |  4 ----
 marionette/tor_browser_tests/test_fp_screen_dimensions.py     |  3 ---
 marionette/tor_browser_tests/test_fp_useragent.py             |  4 ----
 marionette/tor_browser_tests/test_fpcentral.py                |  5 -----
 marionette/tor_browser_tests/test_navigation-timing.py        |  4 ----
 marionette/tor_browser_tests/test_noscript.py                 |  5 +----
 marionette/tor_browser_tests/test_onion_alias.py              |  6 +-----
 marionette/tor_browser_tests/test_onion_client_auth.py        | 11 ++---------
 marionette/tor_browser_tests/test_onion_location.py           |  6 ++----
 .../tor_browser_tests/test_onion_security_expectations.py     | 10 ++--------
 marionette/tor_browser_tests/test_page.py                     |  2 --
 marionette/tor_browser_tests/test_pinning.py                  |  3 +--
 marionette/tor_browser_tests/test_resource-timing.py          |  3 ---
 marionette/tor_browser_tests/test_screenshots.py              |  4 ----
 marionette/tor_browser_tests/test_searchengines.py            |  5 -----
 marionette/tor_browser_tests/test_security_level_ui.py        |  5 +----
 marionette/tor_browser_tests/test_settings.py                 |  5 -----
 marionette/tor_browser_tests/test_slider_settings.py          |  5 -----
 marionette/tor_browser_tests/test_svg.py                      |  4 +---
 marionette/tor_browser_tests/test_user-timing.py              |  3 ---
 27 files changed, 12 insertions(+), 108 deletions(-)

diff --git a/marionette/tor_browser_tests/test_acid3.py b/marionette/tor_browser_tests/test_acid3.py
index 9fa043b..c0f2e78 100644
--- a/marionette/tor_browser_tests/test_acid3.py
+++ b/marionette/tor_browser_tests/test_acid3.py
@@ -1,11 +1,7 @@
-from marionette_driver import By, Wait
-from marionette_driver.errors import MarionetteException
-
+from marionette_driver import Wait
 from marionette_harness import MarionetteTestCase
-
 import testsuite
 
-
 class Test(MarionetteTestCase):
 
     def setUp(self):
diff --git a/marionette/tor_browser_tests/test_check.py b/marionette/tor_browser_tests/test_check.py
index dfe4abf..3d067a9 100755
--- a/marionette/tor_browser_tests/test_check.py
+++ b/marionette/tor_browser_tests/test_check.py
@@ -1,6 +1,3 @@
-from marionette_driver import By
-from marionette_driver.errors import MarionetteException
-
 from marionette_harness import MarionetteTestCase
 
 class Test(MarionetteTestCase):
diff --git a/marionette/tor_browser_tests/test_dom-objects-enumeration-worker.py b/marionette/tor_browser_tests/test_dom-objects-enumeration-worker.py
index 88f5792..5d21d1b 100644
--- a/marionette/tor_browser_tests/test_dom-objects-enumeration-worker.py
+++ b/marionette/tor_browser_tests/test_dom-objects-enumeration-worker.py
@@ -1,4 +1,3 @@
-from marionette_harness import MarionetteTestCase
 import testsuite
 
 class Test(testsuite.TorBrowserTest):
diff --git a/marionette/tor_browser_tests/test_dom-objects-enumeration.py b/marionette/tor_browser_tests/test_dom-objects-enumeration.py
index 3db4366..143a554 100644
--- a/marionette/tor_browser_tests/test_dom-objects-enumeration.py
+++ b/marionette/tor_browser_tests/test_dom-objects-enumeration.py
@@ -4,10 +4,6 @@
 # This test has been suggested in the iSEC partners' report:
 # https://blog.torproject.org/blog/isec-partners-conducts-tor-browser-hardening-study
 
-from marionette_driver import By
-from marionette_driver.errors import MarionetteException
-
-from marionette_harness import MarionetteTestCase
 import testsuite
 
 class Test(testsuite.TorBrowserTest):
diff --git a/marionette/tor_browser_tests/test_download_pdf.py b/marionette/tor_browser_tests/test_download_pdf.py
index 408f63a..6025a64 100644
--- a/marionette/tor_browser_tests/test_download_pdf.py
+++ b/marionette/tor_browser_tests/test_download_pdf.py
@@ -1,8 +1,6 @@
 from marionette_harness import MarionetteTestCase
-
 import testsuite
 
-
 class Test(MarionetteTestCase):
 
     def setUp(self):
diff --git a/marionette/tor_browser_tests/test_fp_navigator.py b/marionette/tor_browser_tests/test_fp_navigator.py
index 1453b0f..91dc951 100644
--- a/marionette/tor_browser_tests/test_fp_navigator.py
+++ b/marionette/tor_browser_tests/test_fp_navigator.py
@@ -1,8 +1,4 @@
-from marionette_driver import By
-from marionette_driver.errors import MarionetteException
-
 from marionette_harness import MarionetteTestCase
-
 import testsuite
 
 # expected values for navigation properties
diff --git a/marionette/tor_browser_tests/test_fp_plugins.py b/marionette/tor_browser_tests/test_fp_plugins.py
index 3f51d61..45981ca 100644
--- a/marionette/tor_browser_tests/test_fp_plugins.py
+++ b/marionette/tor_browser_tests/test_fp_plugins.py
@@ -1,6 +1,3 @@
-from marionette_driver import By
-from marionette_driver.errors import MarionetteException
-
 from marionette_harness import MarionetteTestCase
 
 class Test(MarionetteTestCase):
diff --git a/marionette/tor_browser_tests/test_fp_screen_coords.py b/marionette/tor_browser_tests/test_fp_screen_coords.py
index 208430b..97c2767 100644
--- a/marionette/tor_browser_tests/test_fp_screen_coords.py
+++ b/marionette/tor_browser_tests/test_fp_screen_coords.py
@@ -1,7 +1,3 @@
-
-from marionette_driver import By
-from marionette_driver.errors import MarionetteException
-
 from marionette_harness import MarionetteTestCase
 
 class Test(MarionetteTestCase):
diff --git a/marionette/tor_browser_tests/test_fp_screen_dimensions.py b/marionette/tor_browser_tests/test_fp_screen_dimensions.py
index 879f5c2..2e0af6d 100644
--- a/marionette/tor_browser_tests/test_fp_screen_dimensions.py
+++ b/marionette/tor_browser_tests/test_fp_screen_dimensions.py
@@ -1,6 +1,3 @@
-from marionette_driver import By
-from marionette_driver.errors import MarionetteException
-
 from marionette_harness import MarionetteTestCase
 
 class Test(MarionetteTestCase):
diff --git a/marionette/tor_browser_tests/test_fp_useragent.py b/marionette/tor_browser_tests/test_fp_useragent.py
index a2ef986..5b32bb3 100644
--- a/marionette/tor_browser_tests/test_fp_useragent.py
+++ b/marionette/tor_browser_tests/test_fp_useragent.py
@@ -1,8 +1,4 @@
-from marionette_driver import By
-from marionette_driver.errors import MarionetteException
-
 from marionette_harness import MarionetteTestCase
-
 import testsuite
 
 class Test(MarionetteTestCase):
diff --git a/marionette/tor_browser_tests/test_fpcentral.py b/marionette/tor_browser_tests/test_fpcentral.py
index a698155..a7c8020 100644
--- a/marionette/tor_browser_tests/test_fpcentral.py
+++ b/marionette/tor_browser_tests/test_fpcentral.py
@@ -1,11 +1,6 @@
-from marionette_driver import By
-from marionette_driver.errors import MarionetteException
-
 from marionette_harness import MarionetteTestCase
-
 import testsuite
 
-
 class Test(MarionetteTestCase):
 
     def setUp(self):
diff --git a/marionette/tor_browser_tests/test_navigation-timing.py b/marionette/tor_browser_tests/test_navigation-timing.py
index 9d38697..ce3cb57 100644
--- a/marionette/tor_browser_tests/test_navigation-timing.py
+++ b/marionette/tor_browser_tests/test_navigation-timing.py
@@ -3,10 +3,6 @@
 # Tor Browser. Setting |dom.enable_performance| to |false| and testing that has
 # been not sufficient. See bug 13186 for further details.
 
-from marionette_driver import By
-from marionette_driver.errors import MarionetteException
-
-from marionette_harness import MarionetteTestCase
 import testsuite
 
 class Test(testsuite.TorBrowserTest):
diff --git a/marionette/tor_browser_tests/test_noscript.py b/marionette/tor_browser_tests/test_noscript.py
index 8083098..7d3d274 100644
--- a/marionette/tor_browser_tests/test_noscript.py
+++ b/marionette/tor_browser_tests/test_noscript.py
@@ -1,10 +1,7 @@
 # https://trac.torproject.org/projects/tor/ticket/13053
 
-from marionette_driver import By
-from marionette_driver.errors import MarionetteException, NoSuchElementException
-
+from marionette_driver.errors import NoSuchElementException
 from marionette_harness import MarionetteTestCase
-
 import testsuite
 
 class Test(MarionetteTestCase):
diff --git a/marionette/tor_browser_tests/test_onion_alias.py b/marionette/tor_browser_tests/test_onion_alias.py
index 39dcc49..8f1dc67 100644
--- a/marionette/tor_browser_tests/test_onion_alias.py
+++ b/marionette/tor_browser_tests/test_onion_alias.py
@@ -1,11 +1,7 @@
-from marionette_driver import By, Wait
-from marionette_driver.errors import MarionetteException, NoSuchElementException, TimeoutException
+from marionette_driver import Wait
 from marionette_driver.legacy_actions import Actions
 from marionette_harness import MarionetteTestCase, WindowManagerMixin
 
-import time
-
-
 class Test(WindowManagerMixin, MarionetteTestCase):
     def get_url(self):
         with self.marionette.using_context('content'):
diff --git a/marionette/tor_browser_tests/test_onion_client_auth.py b/marionette/tor_browser_tests/test_onion_client_auth.py
index 38c8a34..1686fa7 100644
--- a/marionette/tor_browser_tests/test_onion_client_auth.py
+++ b/marionette/tor_browser_tests/test_onion_client_auth.py
@@ -1,21 +1,14 @@
-from marionette_driver import By, Wait
-from marionette_driver.errors import MarionetteException, NoSuchElementException, TimeoutException
-from marionette_driver.legacy_actions import Actions
+from marionette_driver import Wait
 from marionette_harness import MarionetteTestCase, WindowManagerMixin
-
-import testsuite
-
 from stem.control import Controller
 from stem.process import launch_tor_with_config
-
 from urlparse import urlparse
 from tempfile import mkdtemp
 import shutil
 import os
 import base64
-
 import time
-
+import testsuite
 
 class Test(WindowManagerMixin, MarionetteTestCase):
     def setUp(self):
diff --git a/marionette/tor_browser_tests/test_onion_location.py b/marionette/tor_browser_tests/test_onion_location.py
index d028d04..37acb2d 100644
--- a/marionette/tor_browser_tests/test_onion_location.py
+++ b/marionette/tor_browser_tests/test_onion_location.py
@@ -1,9 +1,7 @@
-from marionette_driver import By, Wait
-from marionette_driver.errors import MarionetteException, NoSuchElementException, TimeoutException
-
+from marionette_driver import Wait
+from marionette_driver.errors import NoSuchElementException, TimeoutException
 from marionette_harness import MarionetteTestCase, WindowManagerMixin
 
-
 class Test(WindowManagerMixin, MarionetteTestCase):
     # To be investigated in #40007:
     # In 81, marionette.get_url() sometimes fails with:
diff --git a/marionette/tor_browser_tests/test_onion_security_expectations.py b/marionette/tor_browser_tests/test_onion_security_expectations.py
index 866ae1e..7a0fd27 100644
--- a/marionette/tor_browser_tests/test_onion_security_expectations.py
+++ b/marionette/tor_browser_tests/test_onion_security_expectations.py
@@ -1,15 +1,9 @@
-from marionette_driver import By, Wait
-from marionette_driver.errors import MarionetteException, NoSuchElementException, TimeoutException
-from marionette_driver.legacy_actions import Actions
+from marionette_driver import Wait
 from marionette_harness import MarionetteTestCase, WindowManagerMixin
-
-import testsuite
-
 from stem.control import Controller
-
 from urlparse import urlparse
-
 import time
+import testsuite
 
 class OnionFixturesMixin(object):
     def setUp(self):
diff --git a/marionette/tor_browser_tests/test_page.py b/marionette/tor_browser_tests/test_page.py
index 3d1f4cc..f1369c5 100644
--- a/marionette/tor_browser_tests/test_page.py
+++ b/marionette/tor_browser_tests/test_page.py
@@ -1,8 +1,6 @@
 from marionette_harness import MarionetteTestCase
-
 import testsuite
 
-
 class Test(MarionetteTestCase):
 
     def setUp(self):
diff --git a/marionette/tor_browser_tests/test_pinning.py b/marionette/tor_browser_tests/test_pinning.py
index 23e029c..5641e7a 100644
--- a/marionette/tor_browser_tests/test_pinning.py
+++ b/marionette/tor_browser_tests/test_pinning.py
@@ -1,7 +1,6 @@
 from marionette_harness import MarionetteTestCase
-
-import testsuite
 import json
+import testsuite
 
 class Test(MarionetteTestCase):
 
diff --git a/marionette/tor_browser_tests/test_resource-timing.py b/marionette/tor_browser_tests/test_resource-timing.py
index e143f0c..9660725 100644
--- a/marionette/tor_browser_tests/test_resource-timing.py
+++ b/marionette/tor_browser_tests/test_resource-timing.py
@@ -3,9 +3,6 @@
 # Tor Browser. Setting |dom.enable_resource_timing| to |false| and testing that
 # might not be sufficient.
 
-from marionette_driver import By
-from marionette_driver.errors import MarionetteException
-
 from marionette_harness import MarionetteTestCase
 
 class Test(MarionetteTestCase):
diff --git a/marionette/tor_browser_tests/test_screenshots.py b/marionette/tor_browser_tests/test_screenshots.py
index b7cc3d6..4fac52e 100755
--- a/marionette/tor_browser_tests/test_screenshots.py
+++ b/marionette/tor_browser_tests/test_screenshots.py
@@ -1,8 +1,4 @@
-from marionette_driver import By
-from marionette_driver.errors import MarionetteException
-
 from marionette_harness import MarionetteTestCase
-
 import testsuite
 
 class Test(MarionetteTestCase):
diff --git a/marionette/tor_browser_tests/test_searchengines.py b/marionette/tor_browser_tests/test_searchengines.py
index eeb2c6b..9f394f7 100644
--- a/marionette/tor_browser_tests/test_searchengines.py
+++ b/marionette/tor_browser_tests/test_searchengines.py
@@ -6,14 +6,9 @@
 # case while the search engines are still not properly ordered. Rather, we
 # check the entries in the search box directly.
 
-from marionette_driver import By, Wait
-from marionette_driver.errors import MarionetteException
-
 from marionette_harness import MarionetteTestCase
-
 import testsuite
 
-
 class Test(MarionetteTestCase):
 
     def setUp(self):
diff --git a/marionette/tor_browser_tests/test_security_level_ui.py b/marionette/tor_browser_tests/test_security_level_ui.py
index f24e7ea..740934f 100644
--- a/marionette/tor_browser_tests/test_security_level_ui.py
+++ b/marionette/tor_browser_tests/test_security_level_ui.py
@@ -1,9 +1,6 @@
-from marionette_driver import By, Wait
-from marionette_driver.errors import MarionetteException
-
+from marionette_driver import Wait
 from marionette_harness import MarionetteTestCase
 
-
 class Test(MarionetteTestCase):
     def test_security_level_ui(self):
         custom_pref = 'javascript.options.wasm'
diff --git a/marionette/tor_browser_tests/test_settings.py b/marionette/tor_browser_tests/test_settings.py
index b0a9be4..f24cdd0 100644
--- a/marionette/tor_browser_tests/test_settings.py
+++ b/marionette/tor_browser_tests/test_settings.py
@@ -1,11 +1,6 @@
-from marionette_driver import By
-from marionette_driver.errors import MarionetteException
-
 from marionette_harness import MarionetteTestCase
-
 import testsuite
 
-
 class Test(MarionetteTestCase):
 
     def setUp(self):
diff --git a/marionette/tor_browser_tests/test_slider_settings.py b/marionette/tor_browser_tests/test_slider_settings.py
index f61ad21..9b1101a 100644
--- a/marionette/tor_browser_tests/test_slider_settings.py
+++ b/marionette/tor_browser_tests/test_slider_settings.py
@@ -1,11 +1,6 @@
-from marionette_driver import By
-from marionette_driver.errors import MarionetteException
-
 from marionette_harness import MarionetteTestCase
-
 import testsuite
 
-
 class Test(MarionetteTestCase):
 
     def setUp(self):
diff --git a/marionette/tor_browser_tests/test_svg.py b/marionette/tor_browser_tests/test_svg.py
index af55b1b..7dfd120 100644
--- a/marionette/tor_browser_tests/test_svg.py
+++ b/marionette/tor_browser_tests/test_svg.py
@@ -1,7 +1,5 @@
-from marionette_driver.errors import MarionetteException, JavascriptException, NoSuchElementException
-
+from marionette_driver.errors import JavascriptException
 from marionette_harness import MarionetteTestCase
-
 import testsuite
 
 class Test(MarionetteTestCase):
diff --git a/marionette/tor_browser_tests/test_user-timing.py b/marionette/tor_browser_tests/test_user-timing.py
index 9ad56e1..46a74f2 100644
--- a/marionette/tor_browser_tests/test_user-timing.py
+++ b/marionette/tor_browser_tests/test_user-timing.py
@@ -3,9 +3,6 @@
 # Tor Browser. Setting |dom.enable_user_timing| to |false| and testing that
 # might not be sufficient.
 
-from marionette_driver import By
-from marionette_driver.errors import MarionetteException
-
 from marionette_harness import MarionetteTestCase
 
 class Test(MarionetteTestCase):



More information about the tbb-commits mailing list