Skip to content
This repository has been archived by the owner on Nov 6, 2018. It is now read-only.

Commit

Permalink
Merge pull request #119 from nryoung/add-codecov-io
Browse files Browse the repository at this point in the history
Add codecov
  • Loading branch information
nryoung committed Oct 6, 2015
2 parents 725392a + e89bf61 commit ae2cc23
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 13 deletions.
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ matrix:
allow_failures:
- env: TOX_ENV=py35

# command to install dependencies
install: pip install tox
# command to run tests
script: tox -e $TOX_ENV
# codecov
before_install:
- pip install codecov
install:
- pip install tox

script:
- tox -e $TOX_ENV

after_success:
- pip install codecov
- codecov
7 changes: 5 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
Algorithms
==========

.. image:: https://travis-ci.org/nryoung/algorithms.svg?branch=master
:target: https://travis-ci.org/nryoung/algorithms

Algorithms
==========
.. image:: http://codecov.io/github/nryoung/algorithms/coverage.svg?branch=master
:target: http://codecov.io/github/nryoung/algorithms?branch=master

This is an attempt to build a cohesive module of algorithms in Python.

Expand Down
1 change: 1 addition & 0 deletions requirements.txt → requirements/requirements-testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ pluggy==0.3.1
py==1.4.30
pyflakes==0.8.1
pytest==2.8.0
pytest-cov==1.8.1
tox==2.1.1
virtualenv==13.1.2
12 changes: 11 additions & 1 deletion run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ def flake8_main(args):


if __name__ == '__main__':
pytest_args = sys.argv[1:]
run_tests = True
run_flake8 = True

# Logic to run flake8 only
try:
sys.argv.remove('--lintonly')
except ValueError:
Expand All @@ -38,8 +40,16 @@ def flake8_main(args):
run_tests = False
run_flake8 = True

# Logic to run pytest with coverage turned on
try:
pytest_args.remove('--coverage')
except ValueError:
pass
else:
pytest_args = ['--cov', 'algorithms'] + pytest_args

if run_tests:
exit_on_failure(pytest.main())
exit_on_failure(pytest.main(pytest_args))

if run_flake8:
exit_on_failure(flake8_main(FLAKE8_ARGS))
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
envlist = py27, py32, py33, py34, py35

[testenv]
commands = ./run_tests.py
commands = ./run_tests.py --coverage

deps =
pytest
flake8
-rrequirements/requirements-testing.txt

0 comments on commit ae2cc23

Please sign in to comment.