Skip to content

Loosen testing requirements & improve testing #1506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Dec 17, 2020
Merged
3 changes: 2 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ disable=fixme,
old-style-class,
superfluous-parens,
bad-continuation,
line-too-long
line-too-long,
bad-option-value


# Enable the message, report, category or checker with the given id(s). You can
Expand Down
5 changes: 4 additions & 1 deletion .pylintrc37
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ disable=invalid-name,
too-many-lines,
too-many-statements,
bad-continuation,
line-too-long
line-too-long,
super-with-arguments,
raise-missing-from,
bad-option-value

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ All notable changes to `dash` will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/).

## [UNRELEASED]
### Changed
- [#1503](https://github.com/plotly/dash/pull/1506) Fix [#1466](https://github.com/plotly/dash/issues/1466): loosen `dash[testing]` requirements for easier integration in external projects. This PR also bumps many `dash[dev]` requirements.

### Fixed
- [#1493](https://github.com/plotly/dash/pull/1493) Fix [#1143](https://github.com/plotly/dash/issues/1143), a bug where having a file with one of several common names (test.py, code.py, org.py, etc) that imports a dash component package would make `import dash` fail with a cryptic error message asking whether you have a file named "dash.py"

Expand Down
2 changes: 1 addition & 1 deletion dash/testing/application_runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def _stop_server():
stopper()
return "Flask server is shutting down"

# pylint: disable=arguments-differ,C0330
# pylint: disable=arguments-differ
def start(self, app, **kwargs):
"""Start the app server in threading flavor."""
app.server.add_url_rule(self.stop_route, self.stop_route, self._stop_server)
Expand Down
4 changes: 2 additions & 2 deletions dash/testing/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,9 @@ def wait_for_page(self, url=None, timeout=10):

if self._pause:
try:
import pdb as pdb_
import pdb as pdb_ # pylint: disable=import-outside-toplevel
except ImportError:
import ipdb as pdb_
import ipdb as pdb_ # pylint: disable=import-outside-toplevel

pdb_.set_trace()

Expand Down
2 changes: 1 addition & 1 deletion dash/testing/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def pytest_addoption(parser):
def pytest_addhooks(pluginmanager):
# https://github.com/pytest-dev/pytest-xdist/blob/974bd566c599dc6a9ea291838c6f226197208b46/xdist/plugin.py#L67
# avoid warnings with pytest-2.8
from dash.testing import newhooks
from dash.testing import newhooks # pylint: disable=import-outside-toplevel

method = getattr(pluginmanager, "add_hookspecs", None)
if method is None:
Expand Down
21 changes: 11 additions & 10 deletions requires-dev.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
dash_flow_example==0.0.5
dash-dangerously-set-inner-html
isort==4.3.21
mock==4.0.1;python_version>="3.0"
isort==4.3.21;python_version<"3.7"
mock==4.0.3;python_version>="3.0"
mock==3.0.5;python_version=="2.7"
flake8==3.7.9
PyYAML==5.3
pylint==1.9.4;python_version<"3.7"
pylint==2.3.1;python_version=="3.7"
astroid==2.2.5;python_version=="3.7"
flake8==3.8.4
PyYAML==5.3.1
pylint==1.9.5;python_version<"3.7"
pylint==2.6.0;python_version>="3.7"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we sanity test these flake8/pylint changes against the other core repos?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They have an annoying habit of changing their rules..

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call - they may well need their own updates to .pylintrc files, or syntax updates. PRs coming.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plotly/dash-core-components#907, plotly/dash-html-components#171, plotly/dash-table#857 - All three, I started with this branch, got tests passing, then reverted to the dev branch of dash and tests still pass - All that was required (other than prohibiting the latest xlrd) was a couple of linting exclusions.

astroid==2.4.2;python_version>="3.7"
black==19.10b0;python_version>="3.0"
virtualenv==20.0.10;python_version=="2.7"
fire==0.2.1
coloredlogs==14.0
virtualenv==20.2.2;python_version=="2.7"
fire==0.3.1
coloredlogs==15.0
flask-talisman==0.7.0
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved flask-talisman here from requires-testing because this is used in our tests themselves, not in dash.testing.

25 changes: 12 additions & 13 deletions requires-testing.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
pytest==6.0.1;python_version>="3.0"
pytest==4.6.9;python_version=="2.7"
pytest-sugar==0.9.4
pytest-mock==3.2.0;python_version>="3.0"
pytest-mock==2.0.0;python_version=="2.7"
lxml==4.6.1
selenium==3.141.0
percy==2.0.2
cryptography==3.0
requests[security]==2.21.0
beautifulsoup4==4.8.2
waitress==1.4.3
flask-talisman==0.7.0
pytest>=6.0.2;python_version>="3.0"
pytest>=4.6,<5;python_version=="2.7"
pytest-sugar>=0.9.4
pytest-mock>=3.2.0;python_version>="3.0"
pytest-mock>=2.0.0,<3;python_version=="2.7"
lxml>=4.6.2
selenium>=3.141.0
percy>=2.0.2
requests[security]>=2.21.0
beautifulsoup4>=4.8.2,<=4.9.3;python_version=="2.7"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beautifulsoup4 has stated it's about to drop Py2 support, so I set a preemptive upper bound for Py2 at the current version.

beautifulsoup4>=4.8.2;python_version>="3.0"
waitress>=1.4.4
138 changes: 0 additions & 138 deletions tests/integration/IntegrationTests.py

This file was deleted.

Loading