Bug 1274167 - Add Linter(flake8) support for Firefox-ui and Puppeteer.r=whimboo

MozReview-Commit-ID: Ga3iaEH54yH

--HG--
extra : rebase_source : 264c275f6e4bf8feaa2a65479aba43ca1e2cd27e
This commit is contained in:
Piyush Sinha 2016-08-15 02:16:18 +05:30
parent 2721920a34
commit 7e1a93b672
10 changed files with 13 additions and 23 deletions

View File

@ -0,0 +1,3 @@
[flake8]
max-line-length = 99
exclude = __init__.py,

View File

@ -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 marionette_driver import Wait
from firefox_ui_harness.testcases import FirefoxTestCase

View File

@ -125,7 +125,6 @@ class TestRestoreWindowsAfterRestart(FirefoxTestCase):
win.switch_to()
self.open_tabs(win, urls)
def open_tabs(self, win, urls):
""" Opens a set of URLs inside a window in new tabs.

View File

@ -3,8 +3,6 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import mozversion
from marionette_driver.errors import MarionetteException
from firefox_ui_harness.testcases import FirefoxTestCase

View File

@ -13,8 +13,6 @@ class TestMenuBar(FirefoxTestCase):
FirefoxTestCase.setUp(self)
def test_click_item_in_menubar(self):
num_tabs = len(self.browser.tabbar.tabs)
def opener(_):
self.browser.menubar.select_by_id('file-menu',
'menu_newNavigatorTab')

View File

@ -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 marionette_driver import By
from firefox_ui_harness.testcases import FirefoxTestCase

View File

@ -0,0 +1,3 @@
[flake8]
max-line-length = 99
exclude = __init__.py,

View File

@ -39,16 +39,16 @@ class BaseFirefoxTestCase(unittest.TestCase, Puppeteer):
url = []
try:
#Verify the existence of leaked tabs and print their URLs.
# Verify the existence of leaked tabs and print their URLs.
if self._start_handle_count < handle_count:
message = ('A test must not leak window handles. This test started with '
'%s open top level browsing contexts, but ended with %s.'
' Remaining Tabs URLs:') % (self._start_handle_count , handle_count)
' Remaining Tabs URLs:') % (self._start_handle_count, handle_count)
with self.marionette.using_context('content'):
for tab in self.marionette.window_handles:
if tab not in self._init_tab_handles:
url.append(' %s' % self.marionette.get_url())
self.assertListEqual(self._init_tab_handles , self.marionette.window_handles ,
self.assertListEqual(self._init_tab_handles, self.marionette.window_handles,
message + ','.join(url))
finally:
# For clean-up make sure we work on a proper browser window

View File

@ -2,17 +2,8 @@
# 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/.
import firefox_puppeteer.errors as errors
from marionette_driver import By, Wait
from marionette_driver.errors import (
NoSuchElementException,
NoSuchWindowException)
from marionette_driver.keys import Keys
from firefox_puppeteer.api.l10n import L10n
from firefox_puppeteer.api.prefs import Preferences
from firefox_puppeteer.decorators import use_class_as_property
from marionette_driver.errors import NoSuchElementException
from firefox_puppeteer.ui.about_window.window import AboutWindow
from firefox_puppeteer.ui.browser.notifications import (
AddOnInstallBlockedNotification,
@ -25,7 +16,6 @@ from firefox_puppeteer.ui.browser.tabbar import TabBar
from firefox_puppeteer.ui.browser.toolbars import NavBar
from firefox_puppeteer.ui.pageinfo.window import PageInfoWindow
from firefox_puppeteer.ui.windows import BaseWindow, Windows
import firefox_puppeteer.errors as errors
class BrowserWindow(BaseWindow):

View File

@ -123,10 +123,12 @@ LINTER = {
'description': "Python linter",
'include': [
'python/mozlint',
'tools/lint',
'taskcluster',
'testing/firefox-ui',
'testing/marionette/client',
'testing/puppeteer',
'testing/talos/',
'tools/lint',
],
'exclude': [],
'type': 'external',