Skip to content

Commit

Permalink
Merge pull request #78 from zopefoundation/zope-testrunner
Browse files Browse the repository at this point in the history
Switch to zope.testrunner from 'python setup.py test' and 'nose'.
  • Loading branch information
jamadden committed Jul 31, 2018
2 parents 681861b + d015e4f commit 57a4e83
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 58 deletions.
5 changes: 5 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
[run]
source = persistent

[report]
exclude_lines =
# pragma: no cover
class I[A-Z]\w+\((Interface|I[A-Z].*)\):
raise NotImplementedError
raise AssertionError
1 change: 0 additions & 1 deletion .manylinux-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ set -e -x
# Compile wheels
for PYBIN in /opt/python/*/bin; do
if [[ "${PYBIN}" == *"cp27"* ]] || \
[[ "${PYBIN}" == *"cp33"* ]] || \
[[ "${PYBIN}" == *"cp34"* ]] || \
[[ "${PYBIN}" == *"cp35"* ]] || \
[[ "${PYBIN}" == *"cp36"* ]] || \
Expand Down
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ before_install:
- 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
install:
- pip install -e .
- pip install -U pip setuptools
- pip install -U -e .[test]
script:
- python --version
- python setup.py -q test -q
- zope-testrunner --test-path=. --auto-color --auto-progress
notifications:
email: false
after_success:
Expand Down
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ environment:
install:
- "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"
- pip install -e .
- python -m pip install -U pip setuptools wheel
- pip install -e .[test]

build_script:
- pip install wheel
- python -W ignore setup.py -q bdist_wheel

test_script:
- python setup.py -q test -q
- python -m zope.testrunner --test-path=.

artifacts:
- path: 'dist\*.whl'
Expand Down
11 changes: 6 additions & 5 deletions persistent/tests/test_picklecache.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
import sys
import unittest

_py_impl = getattr(platform, 'python_implementation', lambda: None)
_is_pypy = _py_impl() == 'PyPy'
_is_pypy = platform.python_implementation() == 'PyPy'
_is_jython = 'java' in sys.platform

_marker = object()
Expand Down Expand Up @@ -1054,10 +1053,12 @@ def _p_invalidate(cls):
def test_ring_impl(self):
from .. import ring

if _is_pypy or os.getenv('USING_CFFI'):
self.assertTrue(ring.Ring is ring._CFFIRing)
if _is_pypy:
self.assertIs(ring.Ring, ring._CFFIRing)
elif ring._CFFIRing is not None:
self.assertIs(ring.Ring, ring._CFFIRing)
else:
self.assertTrue(ring.Ring is ring._DequeRing)
self.assertIs(ring.Ring, ring._DequeRing)

class DummyPersistent(object):

Expand Down
9 changes: 0 additions & 9 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
[nosetests]
nocapture=1
cover-package=persistent
cover-erase=1
cover-branches=1
cover-min-percentage=100
with-doctest=0
where=persistent

[aliases]
dev = develop easy_install persistent[testing]
docs = develop easy_install persistent[docs]
15 changes: 6 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,13 @@ def _read_file(filename):

README = (_read_file('README.rst') + '\n\n' + _read_file('CHANGES.rst'))

py_impl = getattr(platform, 'python_implementation', lambda: None)
is_pypy = py_impl() == 'PyPy'
is_pypy = platform.python_implementation() == 'PyPy'
is_jython = 'java' in sys.platform
is_pure = os.environ.get('PURE_PYTHON')

# Jython cannot build the C optimizations, while on PyPy they are
# anti-optimizations (the C extension compatibility layer is known-slow,
# and defeats JIT opportunities).
if is_pypy or is_jython or is_pure:
if is_pypy or is_jython:
ext_modules = headers = []
else:
ext_modules = [
Expand Down Expand Up @@ -114,17 +112,16 @@ def _read_file(filename):
ext_modules=ext_modules,
headers=headers,
extras_require={
'test': (),
'testing': [
'nose',
'coverage',
'test': [
'zope.testrunner',
"cffi ; platform_python_implementation == 'CPython'",
],
'testing': (),
'docs': [
'Sphinx',
'repoze.sphinx.autointerface',
],
},
test_suite="persistent.tests",
install_requires=[
'zope.interface',
],
Expand Down
40 changes: 11 additions & 29 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,36 @@ envlist =

[testenv]
deps =
zope.interface
.[test]
commands =
python setup.py -q test -q

[testenv:jython]
commands =
jython setup.py -q test -q
zope-testrunner --test-path=.

[testenv:py27-pure]
basepython =
python2.7
setenv =
PURE_PYTHON = 1
PIP_CACHE_DIR = {envdir}/.cache
deps =
{[testenv]deps}
commands =
python setup.py -q test -q

[testenv:py27-pure-cffi]
basepython =
python2.7
setenv =
PURE_PYTHON = 1
PIP_CACHE_DIR = {envdir}/.cache
USING_CFFI = 1
deps =
{[testenv]deps}
cffi
commands =
python setup.py -q test -q


[testenv:coverage]
usedevelop = true
basepython =
python2.7
setenv =
USING_CFFI = 1
python3.6
commands =
nosetests --with-xunit --with-xcoverage
coverage run -m zope.testrunner --test-path=.
coverage report --fail-under=93
deps =
zope.interface
nose
{[testenv]deps}
coverage
nosexcover
cffi
setenv =
PURE_PYTHON = 1
USING_CFFI = 1

[testenv:docs]
basepython =
Expand All @@ -61,6 +45,4 @@ 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 =
zope.interface
Sphinx
repoze.sphinx.autointerface
.[docs]

0 comments on commit 57a4e83

Please sign in to comment.