-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use tox for testing, add coverage testing
- Loading branch information
Showing
6 changed files
with
81 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
[run] | ||
# measure 'branch' coverage in addition to 'statement' coverage | ||
# See: http://coverage.readthedocs.org/en/coverage-4.0.3/branch.html#branch | ||
branch = True | ||
parallel = True | ||
omit = tests/* | ||
|
||
# list of directories or packages to measure | ||
source = fontmake | ||
|
||
# these are treated as equivalent when combining data | ||
[paths] | ||
source = | ||
Lib/fontmake | ||
*/site-packages/fontmake | ||
|
||
[report] | ||
# Regexes for lines to exclude from consideration | ||
exclude_lines = | ||
# keywords to use in inline comments to skip coverage | ||
pragma: no cover | ||
|
||
# don't complain if tests don't hit defensive assertion code | ||
raise AssertionError | ||
raise NotImplementedError | ||
|
||
# don't complain if non-runnable code isn't run | ||
if 0: | ||
if __name__ == .__main__.: | ||
|
||
# ignore source code that can’t be found | ||
ignore_errors = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
# to native line endings on checkout. | ||
*.cfg text | ||
*.in text | ||
*.ini text | ||
*.md text | ||
*.py text | ||
*.rst text | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
-r requirements.txt | ||
mock==2.0.0; python_version < "3.3" | ||
pytest>=4.5.0 | ||
pytest-cov>=2.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# More info on pytest-cov integration: https://pytest-cov.readthedocs.io/en/latest/tox.html | ||
# Coverage is intentionally not appended to each run because we do not have a coverage | ||
# service set up, it should be used by the developer for local runs only. | ||
|
||
[tox] | ||
envlist = lint, py{36,37}-cov, coverage-report | ||
|
||
[testenv] | ||
deps = | ||
-r test_requirements.txt | ||
commands = | ||
pytest --cov fontmake {posargs} | ||
|
||
[testenv:lint] | ||
skip_install = true | ||
deps = pre-commit | ||
commands = | ||
pre-commit run --all-files --show-diff-on-failure | ||
python -c 'print(r"hint: run {envdir}/bin/pre-commit or {envdir}/Scripts/pre-commit install to add checks as pre-commit hook")' | ||
|
||
[testenv:coverage-report] | ||
skip_install = true | ||
commands = | ||
coverage html |