Skip to content

Commit

Permalink
Merge pull request #2062 from kurtmckee/test-linting-separately
Browse files Browse the repository at this point in the history
Move lint tests to their own tox environments
  • Loading branch information
cyberw authored Mar 30, 2022
2 parents cd835f8 + bae85d9 commit 022dc24
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
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/

0 comments on commit 022dc24

Please sign in to comment.