From: Oleg Broytman Date: Tue, 20 Sep 2016 23:45:58 +0000 (+0300) Subject: Use coverage and tox for testing X-Git-Tag: 0.0.6~17 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=158d41e038a7317f494bfe8893344aa0be3680fa;p=sqlconvert.git Use coverage and tox for testing --- 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 cbf159e..be296d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,23 +1,23 @@ Version 0.0.6 (2016-09-??) - Condense a sequence of newlines after a /*! directive */; + Condense a sequence of newlines after a /*! directive */; - Rename remove_directives -> remove_directive_tokens. + Rename remove_directives -> remove_directive_tokens. - Unescape strings. + Unescape strings. - Use pytest for testing. + Use pytest, coverage and tox for testing. Version 0.0.5 (2016-09-07) - Remove /*! directives */; and newlines after them. + Remove /*! directives */; and newlines after them. - Join group-{file,sql}.py into demo-group.py - parse-{file,sql}.py into demo-parse.py. + Join group-{file,sql}.py into demo-group.py + parse-{file,sql}.py into demo-parse.py. - Add demo-process.py. + Add demo-process.py. - Fix: flush buffer and outfile. + Fix: flush buffer and outfile. Version 0.0.4 (2016-09-04) 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..dec4e03 --- /dev/null +++ b/tox.ini @@ -0,0 +1,41 @@ +[tox] +minversion = 1.8 +envlist = {py26,py27,py34},{py27,py34}-flake8 + +# Base test environment settings +[testenv] +deps = + sqlparse + pytest + pytest-cov + py26: argparse + 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}/sqlconvert + +[testenv:py26] +commands = {[general]commands} + +[testenv:py27] +commands = {[general]commands} + +[testenv:py34] +commands = {[general]commands} + +[testenv:py27-flake8] +deps = + flake8 +commands = flake8 demo scripts sqlconvert tests + +[testenv:py34-flake8] +deps = + flake8 +commands = flake8 demo scripts sqlconvert tests