Skip to content

Commit

Permalink
Show warnings from tests with once:: filter
Browse files Browse the repository at this point in the history
  • Loading branch information
avishayp committed Feb 21, 2020
1 parent 153d141 commit 491eb1d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/drawdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Test with pytest
- name: Test with tox
run: |
pip install pytest
pytest -v --cov=. --cov-report term --cov-report=xml --strict-markers
pip install tox==3.14.0
tox -e ci
- name: Export to codecov.io
uses: codecov/[email protected]
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ __pycache__
.ipynb_checkpoints

.tox
.vscode
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
default: test

test:
pytest -v -m "not slow" --strict-markers -W ignore::DeprecationWarning
tox

alltest:
pytest -v --cov=. --cov-report term-missing --strict-markers -W ignore::DeprecationWarning
tox -e all

alltests: alltest

Expand Down
3 changes: 0 additions & 3 deletions pytest.ini

This file was deleted.

23 changes: 15 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
[tox]
envlist=py38
skipsdist=True
envlist = py38
skipsdist = True

[testenv]
# one virtual env for all test - without this line tox will install .tox/all env to run the 'all' suit
envdir = {toxinidir}/.tox
envdir = {toxworkdir}/common

deps =
-rrequirements.txt

commands =
pytest -v -m "not slow" --strict-markers -W ignore::DeprecationWarning {posargs}
pytest -m "not slow" {posargs}

[testenv:verbose]
[testenv:all]
commands =
pytest -sxv {posargs}
pytest --cov=. --cov-report term-missing {posargs}

[testenv:all]
# runs on github workflow
[testenv:ci]
commands =
pytest -v --strict-markers -W ignore::DeprecationWarning --cov=. --cov-report term-missing {posargs}
pytest --cov=. --cov-report term --cov-report=xml

[pytest]
addopts = -v -W once::DeprecationWarning --strict-markers
ignore = .tox .git data
markers =
slow: mark a test as taking a long time.

0 comments on commit 491eb1d

Please sign in to comment.