diff --git a/.flake8 b/.flake8 index f994d595b..25750c831 100644 --- a/.flake8 +++ b/.flake8 @@ -1,5 +1,5 @@ [flake8] -ignore = E203, E266, E501, E731, W503 +ignore = C901, E203, E266, E501, E731, W503 max-line-length = 88 max-complexity = 18 select = B,C,E,F,W,T4 \ No newline at end of file diff --git a/package.json b/package.json index 3113a9c67..63fc996e0 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "private::build:py": "dash-generate-components src/dash-table/dash/DataTable.js dash_table -p package-info.json && cp dash_table_base/** dash_table/ && dash-generate-components src/dash-table/dash/DataTable.js dash_table -p package-info.json --r-prefix 'dash'", "private::host_js": "http-server ./dash_table -c-1 --silent", "private::lint:ts": "tslint --project tsconfig.json --config tslint.json", - "private::lint:py": "flake8 --exclude=DataTable.py,__init__.py,_imports_.py dash_table && black --check --exclude dash_table .", + "private::lint:py": "flake8 --exclude=DataTable.py,__init__.py,_imports_.py dash_table tests && black --check --exclude dash_table .", "private::wait_js": "wait-on http://localhost:8080", "private::opentests": "cypress open", "private::test.python": "python -m unittest tests/unit/format_test.py", diff --git a/tests/integration/review_app/test_app_df_backend_paging.py b/tests/integration/review_app/test_app_df_backend_paging.py index bd6109eaa..0f3118684 100644 --- a/tests/integration/review_app/test_app_df_backend_paging.py +++ b/tests/integration/review_app/test_app_df_backend_paging.py @@ -204,9 +204,9 @@ def section_title(title): @app.callback( Output(IDS["table"], "data"), - [Input(IDS["table"], "page_current"), Input(IDS["table"], "page_size"),], + [Input(IDS["table"], "page_current"), Input(IDS["table"], "page_size")], ) - def update_graph(page_current, page_size): + def update_data(page_current, page_size): return df.iloc[ page_current * page_size : (page_current + 1) * page_size ].to_dict("rows") @@ -243,7 +243,7 @@ def update_graph(page_current, page_size, sort_by): Input(IDS["table-multi-sorting"], "sort_by"), ], ) - def update_graph(page_current, page_size, sort_by): + def update_multi_data(page_current, page_size, sort_by): # print(sort_by) if len(sort_by): dff = df.sort_values( @@ -267,7 +267,7 @@ def update_graph(page_current, page_size, sort_by): Input(IDS["table-filtering"], "filter_query"), ], ) - def update_graph(page_current, page_size, filter_query): + def updat_filtering_data(page_current, page_size, filter_query): # print(filter_query) filtering_expressions = filter_query.split(" && ") dff = df @@ -298,7 +298,7 @@ def update_graph(page_current, page_size, filter_query): Input(IDS["table-sorting-filtering"], "filter_query"), ], ) - def update_graph(page_current, page_size, sort_by, filter_query): + def update_sorting_filtering_data(page_current, page_size, sort_by, filter_query): filtering_expressions = filter_query.split(" && ") dff = df for filter_query in filtering_expressions: @@ -367,7 +367,7 @@ def update_table(page_current, page_size, sort_by, filter_query): Output(IDS["table-paging-with-graph-container"], "children"), [Input(IDS["table-paging-with-graph"], "data")], ) - def update_graph(rows): + def update_children(rows): dff = pd.DataFrame(rows) return html.Div( [ diff --git a/tests/integration/review_app/test_app_df_graph.py b/tests/integration/review_app/test_app_df_graph.py index e37aa6d92..60dfecd9a 100644 --- a/tests/integration/review_app/test_app_df_graph.py +++ b/tests/integration/review_app/test_app_df_graph.py @@ -7,11 +7,6 @@ import dash_core_components as dcc import dash_html_components as html import dash_table -import time - -from selenium.webdriver.common.by import By -from selenium.webdriver.support import expected_conditions as EC -from selenium.webdriver.support.wait import WebDriverWait ID_PREFIX = "app_data_updating_graph" IDS = {"table": ID_PREFIX, "container": "{}-container".format(ID_PREFIX)} diff --git a/tests/selenium/test_markdown_copy_paste.py b/tests/selenium/test_markdown_copy_paste.py index 1bcab4443..602e4e2d2 100644 --- a/tests/selenium/test_markdown_copy_paste.py +++ b/tests/selenium/test_markdown_copy_paste.py @@ -22,7 +22,7 @@ def get_app(): id="table", data=df[0:250], columns=[ - {"id": "Complaint ID", "name": "Complaint ID", "presentation": "markdown",}, + {"id": "Complaint ID", "name": "Complaint ID", "presentation": "markdown"}, {"id": "Product", "name": "Product", "presentation": "markdown"}, {"id": "Sub-product", "name": "Sub-product"}, {"id": "Issue", "name": "Issue", "presentation": "markdown"}, diff --git a/tests/selenium/test_pagination.py b/tests/selenium/test_pagination.py index 3d4c046b4..324206ad1 100644 --- a/tests/selenium/test_pagination.py +++ b/tests/selenium/test_pagination.py @@ -1,14 +1,11 @@ import dash -from dash.dependencies import Input, Output, State +from dash.dependencies import Input, Output from dash.exceptions import PreventUpdate -import dash_core_components as dcc -import dash_html_components as html from dash_table import DataTable import pytest from selenium.webdriver.common.keys import Keys -from selenium.webdriver.common.action_chains import ActionChains import math import pandas as pd @@ -148,8 +145,6 @@ def test_tpag006_ops_input_invalid_with_enter(test, value, expected_value): target = test.table("table") - text00 = target.cell(0, 0).get_text() - assert target.paging.current.get_value() == "1" target.paging.current.click() @@ -166,8 +161,6 @@ def test_tpag007_ops_input_invalid_with_unfocus(test, value, expected_value): target = test.table("table") - text00 = target.cell(0, 0).get_text() - assert target.paging.current.get_value() == "1" target.paging.current.click() diff --git a/tests/unit/format_test.py b/tests/unit/format_test.py index 63bc5cd35..21aa1ebf9 100644 --- a/tests/unit/format_test.py +++ b/tests/unit/format_test.py @@ -223,16 +223,16 @@ def test_invalid_trim_type(self): def test_valid_decimal_delimiter(self): Format().decimal_delimiter("x") - def test_valid_decimal_delimiter(self): + def test_valid_decimal_delimiter_multi_char(self): self.assertRaises(ValueError, Format().decimal_delimiter, "xyz") def test_invalid_decimal_delimiter(self): self.assertRaises(TypeError, Format().decimal_delimiter, 7) - def test_valid_group_delimiator(self): + def test_valid_group_delimitator(self): Format().group_delimiter("y") - def test_valid_group_delimiator(self): + def test_valid_group_delimitator_multi_char(self): self.assertRaises(ValueError, Format().group_delimiter, "xyz") def test_invalid_group_delimiter(self):