Skip to content
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

Move lint tests to their own tox environments #2062

Merged
merged 2 commits into from
Mar 30, 2022
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
3 changes: 3 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
#- {name: Linux, python: '3.9', os: ubuntu-latest, tox: py39}
#- {name: Windows, python: '3.9', os: windows-latest, tox: py39}
#- {name: Mac, python: '3.9', os: macos-latest, tox: py39}
- { name: "flake8", python: "3.10", os: ubuntu-latest, tox: "flake8" }
- { name: "black", python: "3.10", os: ubuntu-latest, tox: "black" }
- { name: "mypy", python: "3.10", os: ubuntu-latest, tox: "mypy" }
- { name: "3.10", python: "3.10", os: ubuntu-latest, tox: py310 }
- { name: "3.9", python: "3.9", os: ubuntu-latest, tox: py39 }
- { name: "3.8", python: "3.8", os: ubuntu-latest, tox: py38 }
Expand Down
23 changes: 16 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
[tox]
envlist = py{36,37,38,39,310}
envlist =
flake8
black
mypy
py{36,37,38,39,310}

[flake8]
extend-exclude = build,examples/issue_*.py,src/readthedocs-sphinx-search/
Expand All @@ -11,24 +15,29 @@ per-file-ignores =
[testenv]
deps =
codecov
flake8
mock
retry
pyquery
cryptography
black==22.3.0
mypy
allowlist_externals =
bash
timeout
grep
commands =
flake8 . --count --show-source --statistics
coverage run -m unittest discover []
black --check .
mypy locust/
bash -ec 'PYTHONUNBUFFERED=1 timeout 2s python3 examples/debugging.py >out.txt 2>err.txt || true'
grep -qm 1 '/hello' out.txt
bash -ec '! grep . err.txt' # should be empty
bash -ec 'PYTHONUNBUFFERED=1 python3 examples/debugging_advanced.py | grep done'

[testenv:black]
deps = black==22.3.0
commands = black --check .

[testenv:flake8]
deps = flake8
commands = flake8 . --count --show-source --statistics

[testenv:mypy]
deps = mypy
commands = mypy locust/