summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Amici <a.amici@bopen.eu>2018-05-15 20:24:46 +0200
committerAlessandro Amici <a.amici@bopen.eu>2018-05-15 20:24:46 +0200
commite43681cc31c1b2aa0b11941d8d447488e62fa3c5 (patch)
tree8da1ec1ae6b35a2b229b3047221df9ccc9b2f28f
parenta71e21abde0f45155c86d044bf609a7d37a891ba (diff)
Add tox CI testing and requirements-tests.txt.
-rw-r--r--setup.cfg17
-rw-r--r--tests/requirements-tests.in7
-rw-r--r--tests/requirements-tests.txt30
-rw-r--r--tox.ini16
4 files changed, 70 insertions, 0 deletions
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..f80683d
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,17 @@
+[bdist_wheel]
+universal = 1
+
+[aliases]
+test = pytest
+
+[tool:pytest]
+norecursedirs =
+ build
+ dist
+ .tox
+ .eggs
+pep8maxlinelength = 99
+mccabe-complexity = 10
+
+[coverage:run]
+branch = True
diff --git a/tests/requirements-tests.in b/tests/requirements-tests.in
new file mode 100644
index 0000000..1017996
--- /dev/null
+++ b/tests/requirements-tests.in
@@ -0,0 +1,7 @@
+pytest
+pytest-flakes
+pytest-cov
+pytest-env
+pytest-mccabe
+pytest-pep8
+pytest-runner
diff --git a/tests/requirements-tests.txt b/tests/requirements-tests.txt
new file mode 100644
index 0000000..705261a
--- /dev/null
+++ b/tests/requirements-tests.txt
@@ -0,0 +1,30 @@
+#
+# This file is autogenerated by pip-compile
+# To update, run:
+#
+# pip-compile --output-file requirements-tests.txt setup.py requirements-tests.in
+#
+apipkg==1.4 # via execnet
+attrs==18.1.0 # via pytest
+certifi==2018.4.16 # via requests
+chardet==3.0.4 # via requests
+coverage==4.5.1 # via pytest-cov
+execnet==1.5.0 # via pytest-cache
+idna==2.6 # via requests
+mccabe==0.6.1 # via pytest-mccabe
+more-itertools==4.1.0 # via pytest
+pep8==1.7.1 # via pytest-pep8
+pluggy==0.6.0 # via pytest
+py==1.5.3 # via pytest
+pyflakes==1.6.0 # via pytest-flakes
+pytest-cache==1.0 # via pytest-flakes, pytest-mccabe, pytest-pep8
+pytest-cov==2.5.1
+pytest-env==0.6.2
+pytest-flakes==2.0.0
+pytest-mccabe==0.1
+pytest-pep8==1.0.6
+pytest-runner==4.2
+pytest==3.5.1
+requests==2.18.4
+six==1.11.0 # via more-itertools, pytest
+urllib3==1.22 # via requests
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..ecf8e1a
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,16 @@
+[tox]
+envlist = qc, py36, py35, py34, deps
+
+[testenv]
+setenv = PYTHONPATH = {toxinidir}
+deps = -r{toxinidir}/tests/requirements-tests.txt
+commands = pytest -v --flakes --cache-clear --basetemp={envtmpdir} {posargs}
+
+[testenv:qc]
+# needed for pytest-cov
+usedevelop = true
+commands = pytest -v --pep8 --mccabe --cov=cdsapi --cov-report=html --cache-clear {posargs}
+
+[testenv:deps]
+deps =
+commands = python setup.py test