Skip to content

Commit

Permalink
Switch to zope.testrunner from 'python setup.py test' and 'nose'.
Browse files Browse the repository at this point in the history
Both are essentially deprecated.

This is a step in producing usable coverage numbers.

(Also remove cp33 from the manylinux build. This was missed in #74)
  • Loading branch information
jamadden committed Jul 31, 2018
1 parent 681861b commit ecfad66
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 55 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
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 ecfad66

Please sign in to comment.