Skip to content

Commit

Permalink
Automated tests with Tox
Browse files Browse the repository at this point in the history
  • Loading branch information
praneethd7 committed Sep 26, 2023
1 parent ac781d6 commit 5ef407c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with unittest
run: |
python -m unittest
pip install tox tox-gh-actions
- name: Test with Tox
run: tox
23 changes: 17 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
[tox]
env_list =
py{38,39,310,311}
py{36,37,38,39,310}
minversion = 4.11.3

[gh-actions]
python =
3.6: py36, flake8
3.7: py37
3.8: py38
3.9: py39
3.10: py310

[testenv]
description = run the tests with pytest
deps == -rrequirements.txt
description = run the tests with unittest
deps = -rrequirements.txt
commands =
python -m unittest

[testenv:lint]
description = run linters
skip_install = true
deps =
flake8==6.1.0
commands = flake8 {posargs:.}
deps = flake8==6.1.0
commands =
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

0 comments on commit 5ef407c

Please sign in to comment.