Skip to content

Commit

Permalink
Use tox generated environments to support coverage/no-coverage in bot…
Browse files Browse the repository at this point in the history
…h Python

3.4 and 3.5.
  • Loading branch information
warsaw committed Dec 23, 2015
1 parent d8ef13d commit c4e9e7e
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 24 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ var/*
docs/_build/
nosetests.xml
__pycache__/
htmlcov
py34-cov
py35-cov
4 changes: 2 additions & 2 deletions coverage.ini → py34-coverage.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ omit =
setup*
aiosmtpd/testing/*
aiosmtpd/tests/*
.tox/coverage/lib/python3.4/site-packages/*
.tox/py34-cov/lib/python3.4/site-packages/*

[paths]
source =
aiosmtpd
.tox/coverage/lib/python*/site-packages/aiosmtpd
.tox/py34-cov/lib/python*/site-packages/aiosmtpd
13 changes: 13 additions & 0 deletions py35-coverage.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[run]
branch = true
parallel = true
omit =
setup*
aiosmtpd/testing/*
aiosmtpd/tests/*
.tox/py35-cov/lib/python3.5/site-packages/*

[paths]
source =
aiosmtpd
.tox/py35-cov/lib/python*/site-packages/aiosmtpd
34 changes: 13 additions & 21 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,32 +1,24 @@
[tox]
envlist = py34,py35
envlist = {py34,py35}-{cov,nocov}
recreate = True

[testenv]
commands = python -m nose2 -v
commands =
nocov: python -m nose2 -v
cov: python -m coverage run {[coverage]rc} -m nose2 -v
cov: python -m coverage combine {[coverage]rc}
cov: python -m coverage html {[coverage]rc} {[coverage]dir}
#sitepackages = True
usedevelop = True
deps =
nose2
coverage
cov: coverage
setenv =
cov: COVERAGE_PROCESS_START={[coverage]rcfile}
cov: COVERAGE_OPTIONS="-p"
cov: COVERAGE_FILE={toxinidir}/.coverage

[coverage]
rcfile = {toxinidir}/coverage.ini
rcfile = {toxinidir}/{envname}erage.ini
rc = --rcfile={[coverage]rcfile}

[testenv:coverage]
basepython = python3.4
commands =
coverage run {[coverage]rc} -m nose2 -v
coverage combine {[coverage]rc}
coverage html {[coverage]rc}
#sitepackages = True
usedevelop = True
whitelist_externals = python-coverage
deps =
nose2
coverage
setenv =
COVERAGE_PROCESS_START={[coverage]rcfile}
COVERAGE_OPTIONS="-p"
COVERAGE_FILE={toxinidir}/.coverage
dir = --directory={envname}

0 comments on commit c4e9e7e

Please sign in to comment.