diff options
author | Ruben Pollan <meskio@sindominio.net> | 2017-01-26 20:09:04 +0100 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2017-01-26 23:13:58 +0100 |
commit | cb3128966983c26d747bee1e6a79242e9512c21f (patch) | |
tree | 351282af45696afaf4d9356f64a573035c1b0085 | |
parent | eec79703d4f09580b20b06f1c8ca16d4068e128f (diff) |
[test] run the tests with tox and py.test
- Resolves: #14
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | README.md | 14 | ||||
-rw-r--r-- | pkg/requirements-testing.pip | 6 | ||||
-rw-r--r-- | setup.cfg | 20 | ||||
-rw-r--r-- | tox.ini | 14 |
5 files changed, 52 insertions, 5 deletions
@@ -25,9 +25,10 @@ PKG-INFO pip-log.txt # Unit test / coverage reports +docs/cov_html/ .coverage .tox -nosetests.xml +.cache # Translations *.mo @@ -51,6 +51,20 @@ Please use that for bug reports and feature requests instead of github's tracker. We're using github for code commenting and review between collaborators. +### Running Tests + +You need tox to run the tests. If you don't have it in your system yet:: + +~~~ +$ pip install tox +~~~ + +And then run all the tests:: + +~~~ +$ tox +~~~ + ## Issues * see the [Changelog](./CHANGELOG) for details of all major changes in the different versions diff --git a/pkg/requirements-testing.pip b/pkg/requirements-testing.pip index 94b8e9c..322f1e8 100644 --- a/pkg/requirements-testing.pip +++ b/pkg/requirements-testing.pip @@ -1,2 +1,8 @@ pep8 +flake8 +coverage +pytest +pytest-pep8 +pytest-cov +pytest-pdb setuptools-trial @@ -1,9 +1,6 @@ -[aliases] -test = trial - [pep8] exclude = versioneer.py,_version.py,*.egg,build,dist,docs -ignore = E731 +ignore = E731 E402 [flake8] exclude = versioneer.py,_version.py,*.egg,build,dist,docs @@ -15,3 +12,18 @@ style = pep440 versionfile_source = src/leap/mx/_version.py versionfile_build = leap/mx/_version.py tag_prefix = + +[tool:pytest] +pep8ignore = + * E731 E402 + docs/conf.py ALL + versioneer.py ALL + _version.py ALL + *.egg ALL + *_rc.py ALL + +[coverage:run] +branch = True + +[coverage:html] +directory = doc/cov_html @@ -0,0 +1,14 @@ +[tox] +envlist = py27 +skipsdist=True + +[testenv] +commands = py.test --cov-report=html \ + --cov-report=term \ + --cov=leap.mx \ + --pep8 {posargs} +usedevelop = True +deps = + -r{toxinidir}/pkg/requirements-testing.pip +setenv = + HOME=/tmp |