Testing with toxΒΆ

The epifx testing suite uses the pytest framework, and uses the tox automation tool to run the tests. The test cases are contained in the ./tests directory.

To run all tests using all of the Python versions defined in tox.ini, run:

tox

The tox.ini contents are shown below, and include targets that check whether the documentation in ./doc builds correctly.

#
# Configuration file for tox, used to automate test activities.
#
# https://tox.readthedocs.io/en/latest/
#
# This configuration file defines the following test environments:
#
#   test: Run the test cases in ./tests/.
#   docs: Build the package documentation.
#
# To perform each of these test activities, run:
#
#   tox
#
[tox]
envlist = test,docs
isolated_build = True

[base]
pkg = epifx
pytest = {envbindir}/py.test --cov={envsitepackagesdir}/{[base]pkg}
deps =
    {distshare}/pypfilt-0.7.0.*

[testenv:test]
deps =
    {[base]deps}
    pytest
    pytest-cov
allowlist_externals =
    git
commands =
    {envpython} -bb {[base]pytest} {posargs}
    git diff --exit-code --stat tests/

[testenv:docs]
changedir = doc
deps =
    {[base]deps}
    sphinx>=1.4
    sphinx-rtd-theme>=0.1.9
    sphinxcontrib-inlinesyntaxhighlight>=0.2
commands =
    sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html

[pytest]
addopts =
    --capture=no
    --cov-report term
    --cov-report html