Skip to content

Commit d0536d3

Browse files
committed
Use pytest-cov
1 parent 4802f74 commit d0536d3

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

.coveragerc

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[run]
22
branch = True
3+
source = ocfweb,tests
34

45
[report]
56
show_missing = True

Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ DOCKER_TAG_STATIC = $(DOCKER_REPO)ocfweb-static:$(DOCKER_REVISION)
1313
.PHONY: test
1414
test: export OCFWEB_TESTING ?= 1
1515
test: venv
16-
$(BIN)/coverage run -m py.test -v tests/
17-
$(BIN)/coverage report
16+
$(BIN)/py.test -v tests/
1817
$(BIN)/pre-commit run --all-files
1918

2019
.PHONY: Dockerfile.%

pytest.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ DJANGO_SETTINGS_MODULE=ocfweb.settings
55
# you find that this is using too much CPU, change 'auto' to the number of CPUs
66
# you want to parallize across. See https://docs.pytest.org/en/3.0.0/xdist.html
77
# for more details on available options
8-
addopts=--durations=10 -n auto
8+
addopts=--cov --cov-report=term-missing --durations=10 -n auto
99

1010
# Unfortunately this is needed to make pytest-xdist order tests correctly
1111
# between workers to not fail to run any tests due to mismatched test sets

requirements-dev-minimal.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
coverage
21
coveralls
32
pre-commit
43
pytest
5-
pytest-django
4+
pytest-cov
5+
pytest-django<=3.4.0
66
pytest-env
77
pytest-xdist
88
requirements-tools

requirements-dev.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ pathlib2==2.3.2
1414
pluggy==0.7.1
1515
pre-commit==1.10.5
1616
py==1.5.4
17-
pytest==3.7.1
17+
pytest==3.7.2
18+
pytest-cov==2.5.1
1819
pytest-django==3.3.3
1920
pytest-env==0.6.2
2021
pytest-forked==0.2

0 commit comments

Comments
 (0)