Skip to content

Commit

Permalink
Add tox support and coverage reports, run test suite on Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
moreati committed Jul 29, 2015
1 parent 0d7f94c commit 18a0481
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[run]
source = smartcard

[report]
exclude_lines =
pragma: no cover
if __name__ == '__main__':
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ sdist/

MANIFEST

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*

# Generated by SWIG
smartcard/scard/scard.py
smartcard/scard/scard_wrap.c
Expand Down
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ before_install:
- sudo apt-get install -y libpcsclite-dev swig

install:
- pip install wheel
- pip install -r dev-requirements.txt
- pip install .

script:
- python setup.py bdist_wheel
- coverage run setup.py test

after_success:
- coveralls
3 changes: 3 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
coverage
coveralls

2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@
'Pyro': ['Pyro'],
},

'test_suite': 'test',

'classifiers': [
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: GNU Lesser General Public License v2 '
Expand Down
Empty file added test/__init__.py
Empty file.
13 changes: 13 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[tox]
envlist =
py26
py27

[testenv]
deps =
-r{toxinidir}/dev-requirements.txt
commands =
coverage run setup.py test
coverage report
coverage html

0 comments on commit 18a0481

Please sign in to comment.