diff --git a/dash_core_components_base/__init__.py b/dash_core_components_base/__init__.py index a236a451c..2a758db3a 100644 --- a/dash_core_components_base/__init__.py +++ b/dash_core_components_base/__init__.py @@ -19,7 +19,7 @@ "named \n'dash.py' in your current directory.", file=_sys.stderr) _sys.exit(1) -from ._imports_ import * # noqa: F401, F403 +from ._imports_ import * # noqa: F401, F403, E402 from ._imports_ import __all__ # noqa: E402 _current_path = _os.path.dirname(_os.path.abspath(__file__)) diff --git a/dev-requirements.txt b/dev-requirements.txt index 71cc5a1c1..3ead6a1f5 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,4 +1,4 @@ pandas -xlrd +xlrd<2 mimesis;python_version>="3.6" -virtualenv;python_version=="2.7" \ No newline at end of file +virtualenv;python_version=="2.7" diff --git a/tests/integration/location/test_location_callback.py b/tests/integration/location/test_location_callback.py index 2060e23e1..2e1bd356f 100644 --- a/tests/integration/location/test_location_callback.py +++ b/tests/integration/location/test_location_callback.py @@ -87,6 +87,7 @@ def update_pathname(n_clicks, current_pathname): dash_dcc.start_server(app) + dash_dcc.wait_for_text_to_equal("#test-pathname", "/") dash_dcc.percy_snapshot("link -- location") # Check that link updates pathname diff --git a/tests/integration/store/test_store_data.py b/tests/integration/store/test_store_data.py index f4bdf956b..9d465fbb9 100644 --- a/tests/integration/store/test_store_data.py +++ b/tests/integration/store/test_store_data.py @@ -120,7 +120,8 @@ def on_ts(ts, data): @pytest.mark.skipif( - sys.version_info < (3, 6), reason="tests requires dependency only available in 3.6+", + sys.version_info < (3, 6), + reason="tests requires dependency only available in 3.6+", ) @pytest.mark.parametrize("storage_type", ("memory", "local", "session")) def test_stda003_large_data_size(storage_type, csv_5mb, dash_dcc): diff --git a/tests/integration/upload/test_upload_different_file_types.py b/tests/integration/upload/test_upload_different_file_types.py index e9a3452d3..2203f9c39 100644 --- a/tests/integration/upload/test_upload_different_file_types.py +++ b/tests/integration/upload/test_upload_different_file_types.py @@ -1,7 +1,6 @@ import io import base64 import os -import time import pytest import pandas as pd @@ -24,15 +23,10 @@ def load_table(filetype, payload): ) return html.Div( - [ - DataTable( - data=df.to_dict("records"), - columns=[{"id": i} for i in ["city", "country"]], - ), - html.Hr(), - html.Div("Raw Content"), - html.Pre(payload, style=pre_style), - ] + DataTable( + data=df.to_dict("records"), + columns=[{"id": i} for i in ["city", "country"]], + ) ) @@ -40,13 +34,15 @@ def load_data_by_type(filetype, contents): children = [] _type, payload = contents.split(",") if filetype in {"csv", "xlsx", "xls"}: - return load_table(filetype, payload) + children = [load_table(filetype, payload)] elif filetype in {"png", "svg"}: children = [html.Img(src=contents)] - children.extend( - (html.Hr(), html.Div("Raw Content"), html.Pre(payload, style=pre_style)) - ) + children += [ + html.Hr(), + html.Div("Raw Content", id="raw-title"), + html.Pre(payload, style=pre_style), + ] return html.Div(children) @@ -92,5 +88,6 @@ def update_output(contents): upload_div = dash_dcc.wait_for_element("#upload-div input[type=file]") upload_div.send_keys(filepath) - time.sleep(0.5) + + dash_dcc.wait_for_text_to_equal("#raw-title", "Raw Content") dash_dcc.percy_snapshot(filepath)