Browse Source

Run tests with coverage

pull/44/head
hugovk 6 years ago
parent
commit
077da37395
  1. 13
      .coveragerc
  2. 12
      .travis.yml
  3. 6
      tests/test_olefile.py

13
.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
.travis.yml

@ -13,11 +13,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 .

6
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

Loading…
Cancel
Save