From 461d65fc77a3773b4977ecb092704880b890a361 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Wed, 3 Jan 2018 21:35:44 +1000 Subject: [PATCH 1/4] Surround top-level function and class definitions with two blank lines - https://www.python.org/dev/peps/pep-0008/#blank-lines. Remove import json (unused-import). --- tests/utils.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/utils.py b/tests/utils.py index ff97afe370..e817ecd52e 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1,4 +1,3 @@ -import json import time @@ -14,7 +13,6 @@ def wrap(): return wrap - class WaitForTimeout(Exception): """This should only be raised inside the `wait_for` function.""" pass From f5e5d7ee1f87d983ecd08f5bb13f8e3260c7d7a6 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Wed, 3 Jan 2018 21:45:26 +1000 Subject: [PATCH 2/4] Method definitions inside a class are surrounded by a single blank line - https://www.python.org/dev/peps/pep-0008/#blank-lines. Remove unused imports dash, time, re, itertools and json. Remove unused State imported from dash.dependencies (unused-import). Remove unused Event imported from dash.dependencies (unused-import). --- tests/test_integration.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/test_integration.py b/tests/test_integration.py index bef3534917..bd67ca7097 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -1,15 +1,10 @@ from dash import Dash -from dash.dependencies import Input, Output, State, Event -import dash +from dash.dependencies import Input, Output import dash_html_components as html import dash_core_components as dcc from .IntegrationTests import IntegrationTests from .utils import assert_clean_console, invincible, wait_for from multiprocessing import Value -import time -import re -import itertools -import json class Tests(IntegrationTests): @@ -21,7 +16,6 @@ def wait_for_element_by_id(id): return self.driver.find_element_by_id(id) self.wait_for_element_by_id = wait_for_element_by_id - def test_simple_callback(self): app = Dash(__name__) app.layout = html.Div([ From 43de3ec61828c533c019a394485ff22f5ee44f42 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Wed, 3 Jan 2018 21:56:19 +1000 Subject: [PATCH 3/4] Indent code. Remove unused imports - Keys imported from selenium.webdriver.common.keys, dash, dash_core_components, dash_html_components imported as html, importlib, os. Standard imports 'multiprocessing, sys, time, unittest' should be placed before 'from selenium import webdriver' (wrong-import-order) - https://www.python.org/dev/peps/pep-0008/#imports. Method definitions inside a class are surrounded by a single blank line - https://www.python.org/dev/peps/pep-0008/#blank-lines. --- tests/IntegrationTests.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/tests/IntegrationTests.py b/tests/IntegrationTests.py index 5650ecd8d4..ce65de5609 100644 --- a/tests/IntegrationTests.py +++ b/tests/IntegrationTests.py @@ -1,16 +1,9 @@ -from selenium import webdriver -from selenium.webdriver.common.keys import Keys -import dash -import dash_core_components -import dash_core_components as dcc -import dash_html_components as html -import importlib import multiprocessing -import percy +import sys import time import unittest -import os -import sys +from selenium import webdriver +import percy class IntegrationTests(unittest.TestCase): @@ -28,13 +21,12 @@ def setUpClass(cls): cls.driver = webdriver.Chrome() loader = percy.ResourceLoader( - webdriver=cls.driver + webdriver=cls.driver ) cls.percy_runner = percy.Runner(loader=loader) cls.percy_runner.initialize_build() - @classmethod def tearDownClass(cls): super(IntegrationTests, cls).tearDownClass() From 6f4484b5dca7f4074c8bcaf51d1f16f21b14483a Mon Sep 17 00:00:00 2001 From: John Bampton Date: Wed, 3 Jan 2018 22:13:14 +1000 Subject: [PATCH 4/4] Standard import 'from multiprocessing import Value' should be placed before 'import dash_html_components as html' (wrong-import-order). Third party import 'import dash_html_components as html' should be placed before 'from dash import Dash' (wrong-import-order). Third party import 'import dash_core_components as dcc' should be placed before 'from dash import Dash' (wrong-import-order) https://www.python.org/dev/peps/pep-0008/#imports --- tests/test_integration.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_integration.py b/tests/test_integration.py index bd67ca7097..7fdbc53b03 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -1,10 +1,10 @@ -from dash import Dash -from dash.dependencies import Input, Output +from multiprocessing import Value import dash_html_components as html import dash_core_components as dcc +from dash import Dash +from dash.dependencies import Input, Output from .IntegrationTests import IntegrationTests from .utils import assert_clean_console, invincible, wait_for -from multiprocessing import Value class Tests(IntegrationTests):