Skip to content

Commit

Permalink
added Coveralls configuration for code coverage
Browse files Browse the repository at this point in the history
unfortunately, this proved more complex than desired - for reasons that
are not entirely clear (cf. inline comment); debugging SaaS is a pain
  • Loading branch information
FND committed Sep 8, 2013
1 parent 9822bc3 commit e32f634
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,12 @@ python:
install:
- pip install --use-mirrors \
`python -c 'from setup import META; print(" ".join(META["extras_require"]["testing"] + META["install_requires"]))'`
- pip install coveralls
- python setup.py develop

script: make test
script:
- make clean
- coverage run --source=markdown_checklist setup.py test
- coverage report -m

after_success: coveralls
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ dist: clean test
readme:
python -c "import markdown_checklist as cl; print(cl.__doc__.strip())" > README
sed -i "2i[![build status](https://secure.travis-ci.org/FND/markdown-checklist.png)](http://travis-ci.org/FND/markdown-checklist)" README
sed -i "3i[![coverage](https://coveralls.io/repos/FND/markdown-checklist/badge.png)](https://coveralls.io/r/FND/markdown-checklist)" README

test: clean
py.test -s --tb=short test
Expand Down
1 change: 1 addition & 0 deletions README
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[Markdown Checklist](https://github.com/FND/markdown-checklist)
[![build status](https://secure.travis-ci.org/FND/markdown-checklist.png)](http://travis-ci.org/FND/markdown-checklist)
[![coverage](https://coveralls.io/repos/FND/markdown-checklist/badge.png)](https://coveralls.io/r/FND/markdown-checklist)

a [Python Markdown](http://pythonhosted.org/Markdown/) extension for lists of
tasks with checkboxes
Expand Down
20 changes: 20 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import sys
import os

from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand

from markdown_checklist import (__version__ as VERSION, __author__ as AUTHOR,
__license__ as LICENSE, __doc__ as DESC)
Expand Down Expand Up @@ -28,5 +30,23 @@
}


# entry point for tests (required because `coverage` fails to invoke `py.test`
# in Travis CI's virtualenv)

class PyTest(TestCommand):

def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True

def run_tests(self):
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)

META['cmdclass'] = { 'test': PyTest }


if __name__ == '__main__':
setup(**META)

0 comments on commit e32f634

Please sign in to comment.