Commit 57a4e83f authored by Jason Madden's avatar Jason Madden Committed by GitHub

Merge pull request #78 from zopefoundation/zope-testrunner

Switch to zope.testrunner from 'python setup.py test' and 'nose'.
parents 681861b9 d015e4f0
[run]
source = persistent
[report] [report]
exclude_lines = exclude_lines =
# pragma: no cover # pragma: no cover
class I[A-Z]\w+\((Interface|I[A-Z].*)\): class I[A-Z]\w+\((Interface|I[A-Z].*)\):
raise NotImplementedError
raise AssertionError
...@@ -5,7 +5,6 @@ set -e -x ...@@ -5,7 +5,6 @@ set -e -x
# Compile wheels # Compile wheels
for PYBIN in /opt/python/*/bin; do for PYBIN in /opt/python/*/bin; do
if [[ "${PYBIN}" == *"cp27"* ]] || \ if [[ "${PYBIN}" == *"cp27"* ]] || \
[[ "${PYBIN}" == *"cp33"* ]] || \
[[ "${PYBIN}" == *"cp34"* ]] || \ [[ "${PYBIN}" == *"cp34"* ]] || \
[[ "${PYBIN}" == *"cp35"* ]] || \ [[ "${PYBIN}" == *"cp35"* ]] || \
[[ "${PYBIN}" == *"cp36"* ]] || \ [[ "${PYBIN}" == *"cp36"* ]] || \
......
...@@ -56,10 +56,11 @@ before_install: ...@@ -56,10 +56,11 @@ before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source terryfy/travis_tools.sh; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source terryfy/travis_tools.sh; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then get_python_environment $TERRYFY_PYTHON venv; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then get_python_environment $TERRYFY_PYTHON venv; fi
install: install:
- pip install -e . - pip install -U pip setuptools
- pip install -U -e .[test]
script: script:
- python --version - python --version
- python setup.py -q test -q - zope-testrunner --test-path=. --auto-color --auto-progress
notifications: notifications:
email: false email: false
after_success: after_success:
......
...@@ -18,14 +18,14 @@ environment: ...@@ -18,14 +18,14 @@ environment:
install: install:
- "SET PATH=C:\\Python%PYTHON%;c:\\Python%PYTHON%\\scripts;%PATH%" - "SET PATH=C:\\Python%PYTHON%;c:\\Python%PYTHON%\\scripts;%PATH%"
- echo "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 > "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\vcvars64.bat" - echo "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 > "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\vcvars64.bat"
- pip install -e . - python -m pip install -U pip setuptools wheel
- pip install -e .[test]
build_script: build_script:
- pip install wheel
- python -W ignore setup.py -q bdist_wheel - python -W ignore setup.py -q bdist_wheel
test_script: test_script:
- python setup.py -q test -q - python -m zope.testrunner --test-path=.
artifacts: artifacts:
- path: 'dist\*.whl' - path: 'dist\*.whl'
......
...@@ -17,8 +17,7 @@ import platform ...@@ -17,8 +17,7 @@ import platform
import sys import sys
import unittest import unittest
_py_impl = getattr(platform, 'python_implementation', lambda: None) _is_pypy = platform.python_implementation() == 'PyPy'
_is_pypy = _py_impl() == 'PyPy'
_is_jython = 'java' in sys.platform _is_jython = 'java' in sys.platform
_marker = object() _marker = object()
...@@ -1054,10 +1053,12 @@ class PickleCacheTests(unittest.TestCase): ...@@ -1054,10 +1053,12 @@ class PickleCacheTests(unittest.TestCase):
def test_ring_impl(self): def test_ring_impl(self):
from .. import ring from .. import ring
if _is_pypy or os.getenv('USING_CFFI'): if _is_pypy:
self.assertTrue(ring.Ring is ring._CFFIRing) self.assertIs(ring.Ring, ring._CFFIRing)
elif ring._CFFIRing is not None:
self.assertIs(ring.Ring, ring._CFFIRing)
else: else:
self.assertTrue(ring.Ring is ring._DequeRing) self.assertIs(ring.Ring, ring._DequeRing)
class DummyPersistent(object): class DummyPersistent(object):
......
[nosetests]
nocapture=1
cover-package=persistent
cover-erase=1
cover-branches=1
cover-min-percentage=100
with-doctest=0
where=persistent
[aliases] [aliases]
dev = develop easy_install persistent[testing] dev = develop easy_install persistent[testing]
docs = develop easy_install persistent[docs] docs = develop easy_install persistent[docs]
...@@ -32,15 +32,13 @@ def _read_file(filename): ...@@ -32,15 +32,13 @@ def _read_file(filename):
README = (_read_file('README.rst') + '\n\n' + _read_file('CHANGES.rst')) README = (_read_file('README.rst') + '\n\n' + _read_file('CHANGES.rst'))
py_impl = getattr(platform, 'python_implementation', lambda: None) is_pypy = platform.python_implementation() == 'PyPy'
is_pypy = py_impl() == 'PyPy'
is_jython = 'java' in sys.platform is_jython = 'java' in sys.platform
is_pure = os.environ.get('PURE_PYTHON')
# Jython cannot build the C optimizations, while on PyPy they are # Jython cannot build the C optimizations, while on PyPy they are
# anti-optimizations (the C extension compatibility layer is known-slow, # anti-optimizations (the C extension compatibility layer is known-slow,
# and defeats JIT opportunities). # and defeats JIT opportunities).
if is_pypy or is_jython or is_pure: if is_pypy or is_jython:
ext_modules = headers = [] ext_modules = headers = []
else: else:
ext_modules = [ ext_modules = [
...@@ -114,17 +112,16 @@ setup(name='persistent', ...@@ -114,17 +112,16 @@ setup(name='persistent',
ext_modules=ext_modules, ext_modules=ext_modules,
headers=headers, headers=headers,
extras_require={ extras_require={
'test': (), 'test': [
'testing': [ 'zope.testrunner',
'nose', "cffi ; platform_python_implementation == 'CPython'",
'coverage',
], ],
'testing': (),
'docs': [ 'docs': [
'Sphinx', 'Sphinx',
'repoze.sphinx.autointerface', 'repoze.sphinx.autointerface',
], ],
}, },
test_suite="persistent.tests",
install_requires=[ install_requires=[
'zope.interface', 'zope.interface',
], ],
......
...@@ -7,52 +7,36 @@ envlist = ...@@ -7,52 +7,36 @@ envlist =
[testenv] [testenv]
deps = deps =
zope.interface .[test]
commands = commands =
python setup.py -q test -q zope-testrunner --test-path=.
[testenv:jython]
commands =
jython setup.py -q test -q
[testenv:py27-pure] [testenv:py27-pure]
basepython = basepython =
python2.7 python2.7
setenv = setenv =
PURE_PYTHON = 1 PURE_PYTHON = 1
PIP_CACHE_DIR = {envdir}/.cache
deps =
{[testenv]deps}
commands =
python setup.py -q test -q
[testenv:py27-pure-cffi] [testenv:py27-pure-cffi]
basepython = basepython =
python2.7 python2.7
setenv = setenv =
PURE_PYTHON = 1 PURE_PYTHON = 1
PIP_CACHE_DIR = {envdir}/.cache
USING_CFFI = 1 USING_CFFI = 1
deps =
{[testenv]deps}
cffi
commands =
python setup.py -q test -q
[testenv:coverage] [testenv:coverage]
usedevelop = true
basepython = basepython =
python2.7 python3.6
setenv =
USING_CFFI = 1
commands = commands =
nosetests --with-xunit --with-xcoverage coverage run -m zope.testrunner --test-path=.
coverage report --fail-under=93
deps = deps =
zope.interface {[testenv]deps}
nose
coverage coverage
nosexcover setenv =
cffi PURE_PYTHON = 1
USING_CFFI = 1
[testenv:docs] [testenv:docs]
basepython = basepython =
...@@ -61,6 +45,4 @@ commands = ...@@ -61,6 +45,4 @@ commands =
sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
sphinx-build -b doctest -d docs/_build/doctrees docs docs/_build/doctest sphinx-build -b doctest -d docs/_build/doctrees docs docs/_build/doctest
deps = deps =
zope.interface .[docs]
Sphinx
repoze.sphinx.autointerface
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment