Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

use dash loosen-testing-reqs branch and fix linting #907

Merged
merged 8 commits into from
Dec 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dash_core_components_base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__))
Expand Down
4 changes: 2 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pandas
xlrd
xlrd<2
mimesis;python_version>="3.6"
virtualenv;python_version=="2.7"
virtualenv;python_version=="2.7"
1 change: 1 addition & 0 deletions tests/integration/location/test_location_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/store/test_store_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
27 changes: 12 additions & 15 deletions tests/integration/upload/test_upload_different_file_types.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import io
import base64
import os
import time
import pytest
import pandas as pd

Expand All @@ -24,29 +23,26 @@ 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"]],
)
)


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)


Expand Down Expand Up @@ -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)