Skip to content

Commit

Permalink
Update testing infrastructure to match current usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed Jun 2, 2017
1 parent 5dd7a38 commit ee8a1bd
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 62 deletions.
13 changes: 13 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[run]
branch = True
source = zope.annotation

[report]
precision = 2

[paths]
source =
src/
.tox/py*/lib/python*/site-packages/
.tox/nobtree/lib/python*/site-packages/
.tox/pypy*/site-packages/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
__pycache__
coverage.xml
docs/_build
htmlcov/
29 changes: 16 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
language: python
sudo: false
matrix:
include:
- python: 3.5
env: TOXENV=py35
env:
- TOXENV=py27
- TOXENV=py33
- TOXENV=py34
- TOXENV=pypy
- TOXENV=pypy3
python:
- 2.7
- 3.3
- 3.4
- 3.5
- pypy-5.4.1
install:
- travis_retry pip install tox
- pip install -U pip setuptools zope.testrunner
- pip install -U coveralls coverage
- pip install -U -e ".[test]"
script:
- tox
- coverage run -m zope.testrunner --test-path=src --auto-color
after_success:
- coveralls
notifications:
email: false
email: false
cache: pip
before_cache:
- rm -f $HOME/.cache/pip/log/debug.log
15 changes: 0 additions & 15 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,13 @@
"""Setup for zope.annotation package
"""
import os
import sys
from setuptools import setup, find_packages


def read(*rnames):
with open(os.path.join(os.path.dirname(__file__), *rnames)) as f:
return f.read()

def alltests():
# use the zope.testrunner machinery to find all the
# test suites we've put under ourselves
from zope.testrunner.options import get_options
from zope.testrunner.find import find_suites
from unittest import TestSuite
here = os.path.abspath(os.path.dirname(sys.argv[0]))
args = sys.argv[:]
src = os.path.join(here, 'src')
defaults = ['--test-path', src]
options = get_options(args, defaults)
suites = list(find_suites(options))
return TestSuite(suites)

tests_require = [
'zope.component[zcml]',
'zope.configuration',
Expand Down
65 changes: 31 additions & 34 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,45 +1,31 @@
[tox]
envlist =
py27,py33,py34,py35,pypy,pypy3,nobtree,coverage,docs

[base]
deps =
zope.component[zcml]
zope.configuration
zope.interface
zope.location
zope.proxy
zope.testrunner
zope.testing
py27,
py33,
py34,
py35,
pypy,
pypy3,
nobtree,
docs,
coverage,

[testenv]
commands =
python setup.py -q test -q
# without explicit deps, setup.py test will download a bunch of eggs into $PWD
coverage run -m zope.testrunner --test-path=src {posargs:-vc}
deps =
{[base]deps}
BTrees
persistent
.[brees,test]
zope.testrunner
coverage
setenv =
COVERAGE_FILE=.coverage.{envname}

[testenv:nobtree]
basepython =
python2.7
commands =
python setup.py -q test -q
# without explicit deps, setup.py test will download a bunch of eggs into $PWD
deps =
{[base]deps}

[testenv:coverage]
basepython =
python2.7
commands =
coverage erase
coverage run --source=src setup.py -q test -q
coverage report --show-missing
coverage xml
deps =
{[base]deps}
.[test]
zope.testrunner
coverage

[testenv:docs]
Expand All @@ -49,6 +35,17 @@ commands =
sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
sphinx-build -b doctest -d docs/_build/doctrees docs docs/_build/doctest
deps =
{[testenv]deps}
Sphinx
repoze.sphinx.autointerface
.[docs]

[testenv:coverage]
basepython = python2.7
deps = coverage
setenv =
COVERAGE_FILE=.coverage
skip_install = true
commands =
coverage erase
coverage combine
coverage html
coverage xml
coverage report --show-missing

0 comments on commit ee8a1bd

Please sign in to comment.