Skip to content

Commit

Permalink
Merge pull request #44 from hugovk/coverage
Browse files Browse the repository at this point in the history
Run tests with coverage
  • Loading branch information
decalage2 committed Jan 3, 2017
2 parents 27c34c2 + ea0b587 commit 45c8bcf
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .coveragerc
@@ -0,0 +1,13 @@
# .coveragerc to control coverage.py

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma:
pragma: no cover

# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:
# Don't complain about debug code
log.debug
12 changes: 11 additions & 1 deletion .travis.yml
Expand Up @@ -14,11 +14,21 @@ python:
sudo: false

install:
- if [ "$TRAVIS_PYTHON_VERSION" == "2.6" ]; then pip install unittest2; fi

# Coverage 4.0 doesn't support Python 3.2
- if [ "$TRAVIS_PYTHON_VERSION" == "3.2" ]; then pip install "coverage<4"; fi
- if [ "$TRAVIS_PYTHON_VERSION" != "3.2" ]; then pip install coverage; fi

script:
- python -m unittest tests
- coverage run --source=olefile -m nose tests

after_success:
- pip install coveralls
- coveralls

after_script:
- coverage report
- pip install pep8 pyflakes
- pyflakes .
- pep8 --statistics --count .
Expand Down
6 changes: 5 additions & 1 deletion tests/test_olefile.py
@@ -1,6 +1,10 @@
from __future__ import print_function

import unittest
try:
import unittest2 as unittest # Python 2.6
except ImportError:
import unittest


import OleFileIO_PL as OleFileIO

Expand Down

0 comments on commit 45c8bcf

Please sign in to comment.