Skip to content

Commit

Permalink
Merge pull request #6 – Add coverage reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Viktorin authored and GitHub committed Nov 25, 2017
2 parents 67c29dd + 8955a32 commit b587fd6
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 3 deletions.
26 changes: 26 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[run]
branch = True
source =
Lib/
omit =
Lib/slapdtest.py

[paths]
source =
Lib/
.tox/*/lib/python*/site-packages/

[report]
ignore_errors = False
precision = 1
exclude_lines =
pragma: no cover
raise NotImplementedError
if 0:
if __name__ == .__main__.:
if PY2
if not PY2

[html]
directory = build/htmlcov
title = python-ldap coverage report
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
*.pyc
__pycache__/
.tox
.coverage*
!.coveragerc

# shared libs installed by 'setup.py test'
/Lib/*.so*
Expand Down
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ addons:

install:
- pip install "pip>=7.1.0"
- pip install tox-travis tox
- pip install tox-travis tox codecov coverage

script: tox

after_success:
- python -m coverage combine
- codecov
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.NOTPARALLEL:

.PHONY: all
all:

.PHONY: clean
clean:
rm -rf build dist *.egg-info $(VENV) .tox
rm -f .coverage .coverage.*
find . -name '*.py[co]' -or -name '*.so*' -or -name '*.dylib' -delete
find . -depth -name __pycache__ -exec rm -rf {} \;
1 change: 1 addition & 0 deletions Tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@
from . import t_ldapobject
from . import t_edit
from . import t_ldap_schema_subentry
from . import t_untested_mods
15 changes: 15 additions & 0 deletions Tests/t_untested_mods.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# modules without any tests
import ldap.async
import ldap.controls.deref
import ldap.controls.openldap
import ldap.controls.pagedresults
import ldap.controls.ppolicy
import ldap.controls.psearch
import ldap.controls.pwdpolicy
import ldap.controls.readentry
import ldap.controls.sessiontrack
import ldap.controls.sss
import ldap.controls.vlv
import ldap.logger
import ldap.resiter
import ldap.syncrepl
13 changes: 11 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,19 @@

[tox]
# Note: when updating Python versions, also change setup.py and .travis.yml
envlist = py27,py33,py34,py35,py36
envlist = py27,py33,py34,py35,py36,coverage-report

[testenv]
commands = {envpython} setup.py test
deps =
coverage
pyasn1
pyasn1_modules
commands = {envpython} -m coverage run --parallel setup.py test

[testenv:coverage-report]
deps = coverage
skip_install = true
commands =
{envpython} -m coverage combine
{envpython} -m coverage report --show-missing
{envpython} -m coverage html

0 comments on commit b587fd6

Please sign in to comment.