Add tox as a test runner.
This commit adds tox as the Tahrir test runner. It ensures that the unit tests pass, that new code has test coverage, and that the docs build. Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
This commit is contained in:
parent
99ce3f042f
commit
21d4b8f4a1
|
@ -0,0 +1,10 @@
|
|||
[run]
|
||||
branch = True
|
||||
source = tahrir
|
||||
|
||||
[report]
|
||||
precision = 2
|
||||
fail_under = 5.2
|
||||
exclude_lines =
|
||||
pragma: no cover
|
||||
show_missing = True
|
|
@ -1,7 +1,12 @@
|
|||
*.swp
|
||||
*.pyc
|
||||
*.pyo
|
||||
.coverage
|
||||
.tox
|
||||
coverage.xml
|
||||
data
|
||||
docs/_build
|
||||
htmlcov
|
||||
*.swo
|
||||
*.db
|
||||
*.db-journal
|
||||
|
|
|
@ -164,6 +164,15 @@ following command:
|
|||
Once that is running, simply go to http://localhost:8000/ in your browser on
|
||||
your host to see your running tahrir test instance.
|
||||
|
||||
|
||||
Run the tests
|
||||
-------------
|
||||
|
||||
You can use ``tox`` to run the tests::
|
||||
|
||||
$ tox
|
||||
|
||||
|
||||
Windows (32 and 64 bit versions):
|
||||
---------------------------------
|
||||
|
||||
|
|
10
setup.cfg
10
setup.cfg
|
@ -1,10 +1,3 @@
|
|||
[nosetests]
|
||||
match=^test
|
||||
nocapture=1
|
||||
cover-package=tahrir
|
||||
with-coverage=1
|
||||
cover-erase=1
|
||||
|
||||
[compile_catalog]
|
||||
directory = tahrir/locale
|
||||
domain = tahrir
|
||||
|
@ -25,3 +18,6 @@ domain = tahrir
|
|||
input_file = tahrir/locale/tahrir.pot
|
||||
output_dir = tahrir/locale
|
||||
previous = true
|
||||
|
||||
[tool:pytest]
|
||||
addopts = --cov-config .coveragerc --cov=tahrir --cov-report term --cov-report xml --cov-report html
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
[tox]
|
||||
envlist = py27,diff-cover,docs
|
||||
# If the user is missing an interpreter, don't fail
|
||||
skip_missing_interpreters = True
|
||||
|
||||
[testenv]
|
||||
deps =
|
||||
pytest
|
||||
pytest-cov
|
||||
commands =
|
||||
py.test
|
||||
passenv = HOME
|
||||
|
||||
[testenv:diff-cover]
|
||||
deps =
|
||||
diff-cover
|
||||
commands =
|
||||
diff-cover coverage.xml --compare-branch=origin/develop --fail-under=100
|
||||
|
||||
[testenv:docs]
|
||||
changedir = docs
|
||||
deps =
|
||||
sphinx
|
||||
whitelist_externals =
|
||||
mkdir
|
||||
sphinx-build
|
||||
commands=
|
||||
mkdir -p _static
|
||||
sphinx-build -W -b html -d {envtmpdir}/doctrees . _build/html
|
Loading…
Reference in New Issue