Skip to content

Commit 6ea16d1

Browse files
committed
Add coverage report.
1 parent 657dc1d commit 6ea16d1

File tree

9 files changed

+35
-8
lines changed

9 files changed

+35
-8
lines changed

.coveragerc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[run]
2+
plugins = Cython.Coverage

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ script:
2020

2121
after_success:
2222
- ls wheelhouse/
23+
- bash <(curl -s https://codecov.io/bash)
2324

2425
deploy:
2526
provider: releases

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
include bencoder.pyx README.rst LICENSE
1+
include bencoder.c bencoder.pyx README.rst pytest.ini LICENSE
22
recursive-include tests *

appveyor.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
version: '{branch}-{build}'
2+
13
environment:
24
password:
35
secure: pp1j5lAB9NN8ZDasgY+oxoGrNw0+4gGzbNZmHVwJkCzUyrNBP5ZIuCrwjmx4q6ifg7RMiE3bVt9MljFCJh3XpsvVOAcx+AGKsHSjtXd40HM=
@@ -48,6 +50,10 @@ build_script:
4850
test_script:
4951
- "python setup.py test"
5052

53+
on_success:
54+
- pip install codecov
55+
- codecov
56+
5157
deploy_script:
5258
- echo [distutils] > %USERPROFILE%\\.pypirc
5359
- echo index-servers = >> %USERPROFILE%\\.pypirc

ci/build-wheels.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ cp /tmp/wheelhouse/ordereddict* /io/wheelhouse
1919
# Install packages and test
2020
for PYBIN in /opt/python/*/bin/; do
2121
${PYBIN}/pip install bencoder.pyx --no-index -f /io/wheelhouse
22-
(cd $HOME; ${PYBIN}/nosetests bencoder)
22+
(cd $/io; ${PYBIN}/py.test)
2323
done

dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
nose
1+
pytest
22
cython
33
tox

pytest.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[pytest]
2+
testpaths = tests
3+
addopts = -rw --cov=bencoder

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
[bdist_wheel]
2+
3+
[aliases]
4+
test=pytest

setup.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os.path
2+
import sys
23
import platform
34

45
from setuptools import setup
@@ -11,10 +12,19 @@
1112

1213
base_path = os.path.dirname(os.path.abspath(__file__))
1314

14-
try:
15+
if sys.argv[-1] == 'test':
16+
from Cython.Compiler.Options import directive_defaults
17+
18+
directive_defaults['linetrace'] = True
19+
directive_defaults['binding'] = True
20+
1521
from Cython.Build import cythonize
16-
ext_modules = cythonize(os.path.join(base_path, "bencoder.pyx"))
17-
except ImportError:
22+
ext_modules = cythonize(Extension(
23+
"bencoder",
24+
["bencoder.pyx"],
25+
define_macros=[('CYTHON_TRACE', '1')]
26+
))
27+
else:
1828
ext_modules = [Extension(
1929
'bencoder',
2030
[os.path.join(base_path, 'bencoder.c')]
@@ -54,6 +64,8 @@
5464
],
5565
ext_modules=ext_modules,
5666
install_requires=install_requires,
57-
tests_require=['nose'],
58-
test_suite='nose.collector',
67+
setup_requires=[
68+
'pytest-runner',
69+
],
70+
tests_require=['pytest', 'pytest-cov'],
5971
)

0 commit comments

Comments
 (0)