From ca761eabe858ca36bc5a6db14580aa6c026d94c8 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Wed, 21 Sep 2016 02:40:09 +0300 Subject: [PATCH] Use coverage and tox for testing --- .gitignore | 2 ++ ChangeLog | 2 +- requirements_dev.txt | 2 ++ tox.ini | 42 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index 539da74..427ca64 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ +.cache/ +.tox/ *.py[co] diff --git a/ChangeLog b/ChangeLog index 7367ef1..f2174df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ Version 0.0.15 (2016-07-??) - Use pytest for testing. + Use pytest, coverage and tox for testing. Version 0.0.14 (2016-07-29) diff --git a/requirements_dev.txt b/requirements_dev.txt index 73c8ac6..ca2ff5d 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,3 +1,5 @@ -r requirements.txt pytest +pytest-cov +tox >= 1.8 diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..596e198 --- /dev/null +++ b/tox.ini @@ -0,0 +1,42 @@ +[tox] +minversion = 1.8 +envlist = {py26,py27,py34},{py27,py34}-flake8 + +# Base test environment settings +[testenv] +deps = + pytest + pytest-cov + py26: argparse + py26,py27: SQLObject>=2.2.1 + py34: SQLObject>=3.0.0 + py26,py27: m_lib>=2.0 + py34: m_lib>=3.0 +sitepackages = True +# Don't fail or warn on uninstalled commands +whitelist_externals = + flake8 + py.test + +[general] +commands = + python /usr/local/bin/py.test --cov={envsitepackagesdir}/m_librarian + +[testenv:py26] +commands = {[general]commands} + +[testenv:py27] +commands = {[general]commands} + +[testenv:py34] +commands = {[general]commands} + +[testenv:py27-flake8] +deps = + flake8 +commands = flake8 m_librarian scripts test + +[testenv:py34-flake8] +deps = + flake8 +commands = flake8 m_librarian scripts test -- 2.39.2