Skip to content

ci: revisit coverage reporting, use codecov #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,16 @@ language: python
matrix:
include:
- python: 3.5
env: TOX_ENV=py35
env: TOXENV=py35-coverage
- python: 3.6
env: TOX_ENV=py36
env: TOXENV=py36-coverage
- python: 3.7
env: TOX_ENV=py37
# TODO: the dist and sudo keys are currently needed to use Python 3.7.
# They should be removed once Travis-CI supports 3.7 on the default image.
dist: xenial
sudo: true
env: TOXENV=py37-coverage

install: pip install tox-travis coveralls
install: pip install tox

script: tox -e $TOX_ENV
script: tox

after_success:
- tox -e coverage-report
- coveralls
- curl -S -L --connect-timeout 5 --retry 6 -s https://codecov.io/bash -o codecov-upload.sh
- bash codecov-upload.sh -Z -X fix -f coverage.xml
5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ pytest-asyncio: pytest support for asyncio
:target: https://pypi.python.org/pypi/pytest-asyncio
.. image:: https://travis-ci.org/pytest-dev/pytest-asyncio.svg?branch=master
:target: https://travis-ci.org/pytest-dev/pytest-asyncio
.. image:: https://coveralls.io/repos/pytest-dev/pytest-asyncio/badge.svg
:target: https://coveralls.io/r/pytest-dev/pytest-asyncio
.. image:: https://codecov.io/gh/pytest-dev/pytest-asyncio/branch/master/graph/badge.svg
:target: https://codecov.io/gh/pytest-dev/pytest-asyncio
:alt: Code coverage Status
.. image:: https://img.shields.io/pypi/pyversions/pytest-asyncio.svg
:target: https://github.com/pytest-dev/pytest-asyncio
:alt: Supported Python versions
Expand Down
7 changes: 7 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
coverage:
status:
project: true
patch: true
changes: true

comment: off
10 changes: 8 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
[coverage:run]
source = pytest_asyncio
source = pytest_asyncio,tests
branch = 1

[coverage:report]
show_missing = true
show_missing = 1
skip_covered = 1
exclude_lines =
\#\s*pragma: no cover
^\s*raise NotImplementedError\b
^\s*return NotImplemented\b

[tool:pytest]
addopts = -rsx --tb=short
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def find_version():
extras_require={
':python_version == "3.5"': "async_generator >= 1.3",
"testing": [
"coverage",
"async_generator >= 1.3",
"hypothesis >= 3.64",
],
Expand Down
4 changes: 2 additions & 2 deletions tests/test_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async def test_unused_port_fixture(unused_tcp_port, event_loop):
"""Test the unused TCP port fixture."""

async def closer(_, writer):
writer.close()
raise NotImplementedError()

server1 = await asyncio.start_server(closer, host='localhost',
port=unused_tcp_port,
Expand All @@ -62,7 +62,7 @@ async def test_unused_port_factory_fixture(unused_tcp_port_factory, event_loop):
"""Test the unused TCP port factory fixture."""

async def closer(_, writer):
writer.close()
raise NotImplementedError()

port1, port2, port3 = (unused_tcp_port_factory(), unused_tcp_port_factory(),
unused_tcp_port_factory())
Expand Down
4 changes: 2 additions & 2 deletions tests/test_simple_35.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async def test_asyncio_marker_with_default_param(a_param=None):
async def test_unused_port_fixture(unused_tcp_port, event_loop):
"""Test the unused TCP port fixture."""
async def closer(_, writer):
writer.close()
raise NotImplementedError()

server1 = await asyncio.start_server(closer, host='localhost',
port=unused_tcp_port,
Expand All @@ -38,7 +38,7 @@ def test_unused_port_factory_fixture(unused_tcp_port_factory, event_loop):
"""Test the unused TCP port factory fixture."""

async def closer(_, writer):
writer.close()
raise NotImplementedError()

port1, port2, port3 = (unused_tcp_port_factory(), unused_tcp_port_factory(),
unused_tcp_port_factory())
Expand Down
15 changes: 7 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ minversion = 2.5.0

[testenv]
extras = testing
commands = coverage run -m pytest {posargs}

[testenv:coverage-report]
deps = coverage
skip_install = true
commands =
coverage combine
coverage report
deps =
coverage: coverage
commands = {env:COVERAGE_RUN:pytest} {posargs}
coverage: coverage report -m
coverage: coverage xml
setenv =
coverage: COVERAGE_RUN=coverage run -m pytest