Skip to content

Commit

Permalink
Ease running the tests + add coverage tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed Feb 9, 2018
1 parent dace981 commit ea17af2
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/.gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
*.egg-info
*.py?
.coverage
.coverage.py*
.installed*.cfg
.mr.developer.cfg
.tox
/bin/
/build/
coverage.xml
/develop/
/develop-eggs/
/dist/
/eggs/
/etc/
/htmlcov/
/include/
/lib/
/log/
Expand Down
29 changes: 29 additions & 0 deletions src/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
language: python
sudo: false
python:
- 2.7
- 3.4
- 3.5
- 3.6

install:
- pip install six==1.10.0 # force here to avoid conflict with zc.recipe.testrunner
- pip install -U setuptools==33.1.1
- pip install coveralls coverage
- pip install zc.buildout
- buildout bootstrap
- buildout install test

script:
- coverage run bin/test -v1
after_success:
- coverage combine
- coveralls

notifications:
email: false

cache:
pip: true
directories:
- eggs/
14 changes: 14 additions & 0 deletions src/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
include *.rst
include *.txt
recursive-include zmi *.css
recursive-include zmi *.eot
recursive-include zmi *.html
recursive-include zmi *.js
recursive-include zmi *.json
recursive-include zmi *.map
recursive-include zmi *.svg
recursive-include zmi *.ttf
recursive-include zmi *.txt
recursive-include zmi *.woff
recursive-include zmi *.woff2
recursive-include zmi *.zcml
7 changes: 7 additions & 0 deletions src/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
[coverage:run]
branch = True
source = zmi.styles

[coverage:report]
precision = 2

[check-manifest]
ignore =
bootstrap.py
Expand Down
34 changes: 34 additions & 0 deletions src/tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[tox]
envlist =
py27,
py34,
py35,
py36,
coverage-report,

[testenv]
commands =
{envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} bootstrap
{envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test
coverage run {envbindir}/test {posargs:-vc1}
skip_install = true
deps =
setuptools==33.1.1
zc.buildout
coverage
setenv =
PIP_NO_CACHE = 1
COVERAGE_FILE=.coverage.{envname}

[testenv:coverage-report]
basepython = python3.6
deps = coverage
setenv =
COVERAGE_FILE=.coverage
skip_install = true
commands =
coverage erase
coverage combine
coverage html -i
coverage xml -i
coverage report -i

0 comments on commit ea17af2

Please sign in to comment.