Skip to content

Commit

Permalink
Fix coverage in travis
Browse files Browse the repository at this point in the history
  • Loading branch information
don4get committed Jan 15, 2020
1 parent 114d623 commit 9fb4043
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 14 deletions.
19 changes: 19 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[run]
include =
nodedge/*

[report]
include =
nodedge/*
exclude_lines =
# Have to re-enable the standard pragma
\#\s*pragma: no cover

# Don't complain if tests don't hit defensive assertion code:
^\s*raise AssertionError\b
^\s*raise NotImplementedError\b
^\s*return NotImplemented\b
^\s*raise$

# Don't complain if non-runnable code isn't run:
^if __name__ == ['"]__main__['"]:$
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
os: linux
dist: xenial

addons:
apt:
packages:
- x11-utils
- libxkbcommon-x11-0

services: xvfb
dist: xenial

language: python
branches:
only:
- master

sudo: required

before_install:
- sudo apt-get update
Expand All @@ -23,7 +25,7 @@ install:
- sleep 3
- pip install tox

matrix:
jobs:
include:
- python: 3.8
env: TOXENV=flake8
Expand All @@ -36,7 +38,7 @@ matrix:
- python: 3.8
env: TOXENV=py38
- python: 3.6
env: TOXENV=codecov
env: TOXENV=coverage
- python: 3.6
env: TOXENV=check_packaging

Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ include requirements_dev.txt
include requirements_docs.txt
include requirements_tests.txt
include tox.ini
include setup.cfg
include .coveragerc

recursive-include nodedge/qss *
recursive-include nodedge/resources *
Expand Down
6 changes: 6 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[aliases]
test=pytest

[tool:pytest]
addopts = --verbose
python_files = tests/*.py
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
with open("requirements.txt") as requirements_file:
requirements = requirements_file.read()

setup_requirements = []
setup_requirements = ["pytest-runner"]

test_requirements = []
test_requirements = ["pytest"]

# print(find_packages(include=['tage'], exclude=["examples*", "tests*"]))

Expand Down Expand Up @@ -61,7 +61,7 @@
long_description=readme + "\n\n" + history + "\n",
long_description_content_type="text/x-rst",
platforms=PLATFORMS,
packages=find_packages(include="nodedge*", exclude=["tes"]),
packages=find_packages(include="nodedge*", exclude=["tests"]),
setup_requires=setup_requirements,
test_suite="tests",
tests_require=test_requirements,
Expand Down
17 changes: 10 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
[tox]
envlist = py36, py37, py38, black, packaging, codecov
envlist = erase_coverage, py36, py37, py38, black, packaging, coverage

[default]
basepython = python3.8

[testenv:begin]
commands = coverage erase

[testenv]
passenv = DISPLAY XAUTHORITY
setenv =
PYTHONPATH = {toxinidir}
commands = pytest -s -vv --cov-append --cov=nodedge
commands =
pytest -s -vv
deps =
-rrequirements.txt
-rrequirements_tests.txt
Expand Down Expand Up @@ -37,7 +41,7 @@ select = B,C,E,F,W,T4,B9
[testenv:check_packaging]

description = check for potential packaging problems
basepython = {[default]basepython}
basepython = python3.6
skip_install = True
deps =
check-manifest==0.40
Expand All @@ -49,14 +53,13 @@ commands =
pip wheel --wheel-dir "{envtmpdir}/dist" --no-deps {toxinidir}
twine check "{envtmpdir}/dist/"*

[testenv:codecov]
deps =
codecov
[testenv:coverage]
skip_install = true
usedevelop = false
setenv =
COVERAGE_FILE=.coverage
commands =
coverage run --append setup.py test
coverage report
coverage xml --ignore-errors
coverage html
codecov []

0 comments on commit 9fb4043

Please sign in to comment.