Skip to content

Commit 0a1f1fc

Browse files
committed
Add pytest integration files
1 parent a3f3403 commit 0a1f1fc

File tree

5 files changed

+39
-3
lines changed

5 files changed

+39
-3
lines changed

.coveragerc

+1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ omit =
77
**/tests/*.py
88
env*
99
settings.py
10+
conftest.py
1011
local_settings.py
1112
/home/travis/virtualenv*

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ env/
1818

1919
# coverage
2020
.coverage
21+
htmlcov

.travis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ cache: pip
66
install: "pip install -r requirements.txt && pip install coveralls pylint"
77

88
script:
9-
- python manage.py collectstatic --noinput
10-
- coverage run --rcfile .coveragerc manage.py test
11-
- pylint devel main mirrors news packages releng templates todolists visualize *.py
9+
- make collectstatic
10+
- make lint
11+
- make coverage
1212

1313
after_success:
1414
- coveralls

Makefile

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
PYTHON>=python
2+
PYTEST?=pytest
3+
PYTEST_OPTIONS+=
4+
PYTEST_INPUT?=.
5+
PYTEST_COVERAGE_OPTIONS+=--cov-report=term-missing --cov-report=html:htmlcov --cov=.
6+
PYTEST_PDB?=0
7+
PYTEST_PDB_OPTIONS?=--pdb --pdbcls=IPython.terminal.debugger:TerminalPdb
8+
9+
10+
ifeq (${PYTEST_PDB},1)
11+
PYTEST_OPTIONS+= ${PYTEST_PDB_OPTIONS}
12+
else
13+
test-pdb: PYTEST_OPTIONS+= ${PYTEST_PDB_OPTIONS}
14+
endif
15+
test-pdb: test
16+
17+
18+
.PHONY: test lint
19+
20+
lint:
21+
pylint devel main mirrors news packages releng templates todolists visualize *.py
22+
23+
collecstatic:
24+
python manage.py collecstatic --noinput
25+
26+
test: test-py
27+
28+
test-py coverage:
29+
${PYTEST} ${PYTEST_INPUT} ${PYTEST_OPTIONS} ${PYTEST_COVERAGE_OPTIONS}
30+
31+
open-coverage: coverage
32+
${BROWSER} htmlcov/index.html

pytest.ini

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[pytest]
2+
DJANGO_SETTINGS_MODULE = settings

0 commit comments

Comments
 (0)