summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2017-01-26 20:09:04 +0100
committerRuben Pollan <meskio@sindominio.net>2017-01-26 23:13:58 +0100
commitcb3128966983c26d747bee1e6a79242e9512c21f (patch)
tree351282af45696afaf4d9356f64a573035c1b0085
parenteec79703d4f09580b20b06f1c8ca16d4068e128f (diff)
[test] run the tests with tox and py.test
- Resolves: #14
-rw-r--r--.gitignore3
-rw-r--r--README.md14
-rw-r--r--pkg/requirements-testing.pip6
-rw-r--r--setup.cfg20
-rw-r--r--tox.ini14
5 files changed, 52 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
index 173cac5..dc8af53 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,9 +25,10 @@ PKG-INFO
pip-log.txt
# Unit test / coverage reports
+docs/cov_html/
.coverage
.tox
-nosetests.xml
+.cache
# Translations
*.mo
diff --git a/README.md b/README.md
index c78b14b..cd55f6d 100644
--- a/README.md
+++ b/README.md
@@ -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
diff --git a/setup.cfg b/setup.cfg
index d8a5cc1..b58cc41 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -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
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..417bd18
--- /dev/null
+++ b/tox.ini
@@ -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