diff --git a/python/.coveragerc b/python/.coveragerc new file mode 100644 index 0000000000..44d6547605 --- /dev/null +++ b/python/.coveragerc @@ -0,0 +1,24 @@ +[run] +branch = True +include = sbp/* + +[report] +exclude_lines = + # Have to re-enable the standard pragma + pragma: no cover + + # Don't complain about missing debug-only code: + def __repr__ + if self\.debug + + # Don't complain if non-runnable code isn't run: + if 0: + if __name__ == .__main__.: + +ignore_errors = True + +[omit] +omit = + tests/* + limbo/* + data/* \ No newline at end of file diff --git a/python/README.md b/python/README.md index 6558b7e3c5..82fe267601 100644 --- a/python/README.md +++ b/python/README.md @@ -13,11 +13,13 @@ pip install libsbp ## Usage -```python +```shell +# To run the tests and check for coverage: +py.test -v --cov sbp tests/ ``` ## LICENSE Copyright © 2015 Swift Navigation -Distributed under LGPLv3.0. \ No newline at end of file +Distributed under LGPLv3.0. diff --git a/python/requirements.txt b/python/requirements.txt new file mode 100644 index 0000000000..49adb86bb4 --- /dev/null +++ b/python/requirements.txt @@ -0,0 +1,13 @@ +construct==2.5.2 +cov-core==1.15.0 +coverage==3.7.1 +flake8==2.3.0 +futures==2.2.0 +pep8==1.5.7 +pyftdi==0.6.3 +pylibftdi==0.14.2 +pyserial==2.7 +pytest==2.6.4 +pytest-cov==1.8.1 +tox==1.8.1 +virtualenv==1.11.6 diff --git a/python/tox.ini b/python/tox.ini new file mode 100644 index 0000000000..4ce78e8cfa --- /dev/null +++ b/python/tox.ini @@ -0,0 +1,16 @@ +[tox] +envlist = py27 + +[testenv] +deps = + pytest + -rrequirements.txt +commands = py.test -v --cov sbp tests/ +sitepackages = False +usedevelop = True + +[flake8] +ignore = E126,E127,E111 +max-line-length = 100 +exclude = tests/*,limbo/* +max-complexity = 10 \ No newline at end of file