Skip to content

Commit

Permalink
add coverage and coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
obestwalter committed Jul 20, 2019
1 parent d26174b commit 415c607
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 4 deletions.
17 changes: 17 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[run]
; needs coverage>=5 (and still causes touble in this setup)
;dynamic_context = test_function
branch = True
source = i3configger
omit =
*__main__.py
*/bindings.py
*/inotify_simple.py

[report]
exclude_lines =
pragma: no cover
raise NotImplementedError

[html]
directory = .coverage-html
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ archive/*

site/*
.messages.json
.coverage-html
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ jobs:
script: tox -e lint
- stage: test
script: tox -e test
after_success:
- tox -e coveralls
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)
[![Build Status](https://travis-ci.org/obestwalter/i3configger.svg?branch=master)](https://travis-ci.org/obestwalter/i3configger)
[![PyPI version](https://badge.fury.io/py/i3configger.svg)](https://pypi.org/project/i3configger/)
[![Build Status](https://travis-ci.org/obestwalter/i3configger.svg?branch=master)](https://travis-ci.org/obestwalter/i3configger)
[![Coverage Status](https://coveralls.io/repos/github/obestwalter/i3configger/badge.svg?branch=master)](https://coveralls.io/github/obestwalter/i3configger?branch=master)
[![Documentation](https://img.shields.io/badge/docs-sure!-brightgreen.svg)](http://oliver.bestwalter.de/i3configger)
[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def make_long_description():
install_requires=["psutil", "python-daemon"],
extras_require={
"lint": ["pre-commit"],
"test": ["pytest"],
"test": ["pytest", "coverage"],
"docs": ["mkdocs", "mkdocs-material"],
"release": ["plumbum", "twine", "readme_renderer[md]"],
},
Expand Down
12 changes: 10 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ xfail_strict = True

[testenv]
basepython = python3.7
usedevelop = True
extras =
lint: lint
test: test
Expand All @@ -29,7 +28,15 @@ commands =

[testenv:test]
description = run tests with pytest
commands = pytest tests
commands =
coverage run -m pytest
coverage report

[testenv:coveralls]
description = send report to coveralls
setenv = COVERALLS_REPO_TOKEN = zCycry7u83alwoxtvxKfZPMNGXVM37qzq
deps = coveralls
commands = coveralls

[testenv:release]
description = release to PyPI
Expand Down Expand Up @@ -67,6 +74,7 @@ commands =

[testenv:dev]
description = dev env at {envpython}
usedevelop = True
extras =
lint
test
Expand Down

0 comments on commit 415c607

Please sign in to comment.