Skip to content

Commit

Permalink
Tox cleanups and use tox in PR tests (etsy#73)
Browse files Browse the repository at this point in the history
* Use {posargs} in tox.ini to be more flexible

* use tox in the github pr test

* remove some deps from github action, they are in tox

* add comment

* Move coveralls out of travis

* coverage path

* coverage path

* Revert "coverage path"

This reverts commit 5936537.

* Revert "coverage path"

This reverts commit 6fbd56c.

* Revert "Move coveralls out of travis"

This reverts commit 3c48d33.
  • Loading branch information
dossett authored and m-lce committed Mar 22, 2021
1 parent e042a02 commit f4cd4f6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/python-app.yml
Expand Up @@ -26,13 +26,14 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest mock pytest-mock .[github]
pip install tox flake8
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 boundary_layer boundary_layer_default_plugin bin test --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 boundary_layer boundary_layer_default_plugin bin test --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
- name: Test with tox
run: |
pytest test
# py`echo ${{ matrix.python-version }} | tr -d '.'` yields py27, py35, etc. which is what tox needs
tox --recreate -e py`echo ${{ matrix.python-version }} | tr -d '.'` test
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -17,7 +17,7 @@ matrix:
install:
- pip install --upgrade tox coveralls

script: tox
script: tox --recreate test

after_success:
- ./run_coveralls.sh
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -18,7 +18,7 @@ These are the steps for submitting a proposed contribution to boundary-layer:
3. Make your changes
4. Document new functionality as appropriate
5. Add new tests if possible
6. [Recommended] Run the test suite locally with `tox`
6. [Recommended] Run the test suite locally with `tox --recreate test`
7. Push your changes to your fork
8. Send a pull request!

Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Expand Up @@ -11,7 +11,7 @@ deps = pytest==3.8.1
extras =
github
commands =
pytest -vv test
pytest -vv {posargs}

[testenv:py27]
commands =
Expand All @@ -21,7 +21,7 @@ commands =
--cov=boundary_layer_default_plugin \
--cov-report=term-missing \
--cov-report=xml \
test
{posargs}

[testenv:lint]
commands =
Expand Down

0 comments on commit f4cd4f6

Please sign in to comment.