Skip to content

Add code coverage reports #220

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

Merged
merged 2 commits into from
Apr 25, 2016
Merged
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
8 changes: 8 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[run]
branch = True
source = html5lib

[paths]
source =
html5lib
.tox/*/lib/python*/site-packages/html5lib
18 changes: 5 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,19 @@ env:
- USE_OPTIONAL=true
- USE_OPTIONAL=false

matrix:
exclude:
- python: "2.7"
env: USE_OPTIONAL=false
- python: "3.4"
env: USE_OPTIONAL=false
include:
- python: "2.7"
env: USE_OPTIONAL=false FLAKE=true
- python: "3.4"
env: USE_OPTIONAL=false FLAKE=true

before_install:
- git submodule update --init --recursive

install:
- bash requirements-install.sh

script:
- py.test
- if [[ $TRAVIS_PYTHON_VERSION == pypy* ]]; then py.test; fi
- if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then coverage run -m pytest; fi
- bash flake8-run.sh

after_script:
- python debug-info.py

after_success:
- if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then coverage combine && codecov; fi
12 changes: 5 additions & 7 deletions flake8-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ if [[ ! -x $(which flake8) ]]; then
exit 1
fi

if [[ $TRAVIS != "true" || $FLAKE == "true" ]]; then
find html5lib/ -name '*.py' -and -not -name 'constants.py' -print0 | xargs -0 flake8 --ignore=E501
flake1=$?
flake8 --max-line-length=99 --ignore=E126 html5lib/constants.py
flake2=$?
exit $[$flake1 || $flake2]
fi
find html5lib/ -name '*.py' -and -not -name 'constants.py' -print0 | xargs -0 flake8 --ignore=E501
flake1=$?
flake8 --max-line-length=99 --ignore=E126 html5lib/constants.py
flake2=$?
exit $[$flake1 || $flake2]
4 changes: 4 additions & 0 deletions requirements-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ pip install -U -r requirements-test.txt
if [[ $USE_OPTIONAL == "true" ]]; then
pip install -U -r requirements-optional.txt
fi

if [[ $CI == "true" ]]; then
pip install -U codecov
fi