Skip to content

Commit 0e245cc

Browse files
committed
tests: add coverage tests with tox
1 parent 83115b6 commit 0e245cc

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

pyproject.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[tool.coverage.run]
2+
branch = true
3+
source = ["wtforms_sqlalchemy", "tests"]
4+
5+
[tool.coverage.paths]
6+
source = ["src", "*/site-packages"]
7+
8+
[tool.coverage.report]
9+
exclude_lines = [
10+
"pragma: no cover",
11+
"except ImportError:",
12+
]

tox.ini

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
[tox]
2-
envlist = py38, py39, py310, py311, py312, style, docs
2+
envlist = style, py312, py311, py310, py39, py38, coverage, docs
33

44
[testenv]
55
deps =
6-
coverage
76
pytest
8-
setenv =
9-
PYTHONPATH = {toxinidir}:{toxinidir}/
10-
commands = pytest
7+
commands = pytest {posargs}
118

129
[testenv:style]
1310
deps = pre-commit
@@ -17,3 +14,12 @@ commands = pre-commit run --all-files --show-diff-on-failure
1714
[testenv:docs]
1815
deps = -r docs/requirements.txt
1916
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html
17+
18+
[testenv:coverage]
19+
deps =
20+
pytest
21+
coverage
22+
commands =
23+
coverage run -m pytest --tb=short --basetemp={envtmpdir} {posargs}
24+
coverage html
25+
coverage report

0 commit comments

Comments
 (0)