Skip to content

Commit b902fd2

Browse files
committed
Drop pytest-cov
1 parent 10fb6a8 commit b902fd2

8 files changed

+45
-14
lines changed

.coveragerc

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
11
[run]
2-
plugins = Cython.Coverage
2+
plugins = Cython.Coverage
3+
source = bencoder
4+
5+
[report]
6+
exclude_lines =
7+
pragma: no cover
8+
9+
def __repr__
10+
11+
raise AssertionError
12+
raise NotImplementedError
13+
14+
if 0:
15+
if __name__ == .__main__.:

ci/build-wheels.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ cp /tmp/wheelhouse/ordereddict* /io/wheelhouse
2020
for PYBIN in /opt/python/*/bin/; do
2121
${PYBIN}/pip install bencoder.pyx --no-index -f /io/wheelhouse
2222
${PYBIN}/pip install pytest
23-
(cd /io; ${PYBIN}/py.test -c pytest-nocov.ini)
23+
(cd /io; ${PYBIN}/py.test)
2424
done

dev-requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
pytest
2-
pytest-cov
2+
coverage
33
cython
44
tox

pytest-nocov.ini

-3
This file was deleted.

pytest.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[pytest]
22
testpaths = tests
3-
addopts = -rw --cov=bencoder
3+
addopts = -rw

setup.cfg

-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
11
[bdist_wheel]
2-
3-
[aliases]
4-
test=pytest

setup.py

+26-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from setuptools import setup
66
from setuptools.extension import Extension
7+
from setuptools.command.test import test as TestCommand
78

89
version = platform.python_version_tuple()
910
install_requires = []
@@ -39,8 +40,31 @@
3940
))
4041

4142

43+
class PyTest(TestCommand):
44+
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
45+
46+
def initialize_options(self):
47+
TestCommand.initialize_options(self)
48+
self.pytest_args = []
49+
50+
def run_tests(self):
51+
#import here, cause outside the eggs aren't loaded
52+
import coverage
53+
cov = coverage.Coverage()
54+
cov.start()
55+
56+
import pytest
57+
errno = pytest.main(self.pytest_args)
58+
59+
cov.stop()
60+
cov.save()
61+
sys.exit(errno)
62+
63+
64+
cmdclass = {'test': PyTest}
65+
66+
4267
# patch bdist_wheel
43-
cmdclass = {}
4468
try:
4569
from wheel.bdist_wheel import bdist_wheel
4670

@@ -101,5 +125,5 @@ def get_tag(self):
101125
setup_requires=[
102126
'pytest-runner',
103127
],
104-
tests_require=['cython', 'pytest', 'pytest-cov'],
128+
tests_require=['cython', 'pytest', 'coverage'],
105129
)

tox.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ skip_install = True
77
deps =
88
cython
99
pytest
10-
pytest-cov
10+
coverage
1111

1212
[testenv:pypy]
1313
skip_install = False
1414
deps =
1515
cython
1616
pytest
17-
commands = py.test -c pytest-nocov.ini
17+
commands = py.test

0 commit comments

Comments
 (0)