From: Mike Bayer Date: Tue, 9 Sep 2014 16:10:10 +0000 (-0400) Subject: - add a tox.ini file X-Git-Tag: rel_0_6_7~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=931de83e0e0089f196b7bc792d652112f05d8a8d;p=thirdparty%2Fsqlalchemy%2Falembic.git - add a tox.ini file - update the readme.unittests a bit --- diff --git a/.gitignore b/.gitignore index 93554cb6..a252ee8e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ dist/ /docs/build/output/ *.orig alembic.ini -tox.ini .venv *.egg-info .coverage +.tox diff --git a/README.unittests b/README.unittests.rst similarity index 86% rename from README.unittests rename to README.unittests.rst index 61796b61..b84aa7a6 100644 --- a/README.unittests +++ b/README.unittests.rst @@ -1,14 +1,17 @@ Running Unit Tests ================== -Tests can be run using the nosetests runner: +Tests can be run be run using via py.test, nose, or the Python setup.py script:: - nosetests -v + py.test -Or via the setup.py script: + nosetests -v python setup.py test +There's also a tox.ini file with several configurations:: + + tox Setting up Optional Databases ------------------------------ diff --git a/setup.cfg b/setup.cfg index 530eb95e..0052af88 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,6 +16,6 @@ identity = C4DAFEE1 [pytest] addopts= --tb native -v -r fxX -python_files=tests/*test_*.py +python_files=tests/test_*.py diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..61da07d5 --- /dev/null +++ b/tox.ini @@ -0,0 +1,36 @@ +[tox] +envlist = full + +[testenv] +deps=pytest + flake8 + coverage + mock + +sitepackages=True +usedevelop=True + +commands= + python -m pytest {posargs} + +[testenv:full] + + +[testenv:coverage] + +commands= + python -m pytest \ + --cov=alembic \ + {posargs} + python -m coverage xml --include=alembic/* + +[testenv:pep8] +commands = python -m flake8 {posargs} + + +[flake8] + +show-source = True +ignore = E711,E712,E721,F841,F811 +exclude=.venv,.git,.tox,dist,doc,*egg,build +