fonttools/tox.ini
Cosimo Lupo 87894641c0 pytest 4.0 doesn't recognize module name if listed in 'testpaths'
'fontTools' is not a folder name, but the import name of the package
where we have some doctests to be discovered and run.

even though we have --pyargs option (which makes pytest first attempt
to treat any positional arguments as module import names), with the
latest pytest 4.0.0 our tests started to fail as if the new pytest
is evaluating the default 'testpaths' (as defined in setup.cfg, used
when no arguments are supplied to pytest) _before_ the --pyargs
option, and thus it thinks that 'fontTools' is a directory name
instead of a package name...

This a workaround. It also means that if one runs `pytest` without
arguments, only the tests inside `Tests` directory are going to be
run automatically, and not also the doctests inside fontTools package.

When running the test suite using tox, all tests are run, both
those in Tests folder and the doctests in fontTools.
2018-11-15 08:47:20 +00:00

77 lines
1.7 KiB
INI

[tox]
minversion = 3.0
envlist = py{27,37}-cov, htmlcov
[testenv]
deps =
cov: coverage>=4.3
pytest
-rrequirements.txt
extras =
ufo
woff
unicode
interpolatable
!nolxml: lxml
commands =
# test with or without coverage, passing extra positonal args to pytest
cov: coverage run --parallel-mode -m pytest {posargs:Tests fontTools}
!cov: pytest {posargs:Tests fontTools}
[testenv:htmlcov]
deps =
coverage>=4.3
skip_install = true
commands =
coverage combine
coverage html
[testenv:codecov]
passenv = *
deps =
coverage>=4.3
codecov
skip_install = true
ignore_outcome = true
commands =
coverage combine
codecov --env TOXENV
[testenv:package_readme]
description = check that the long description is valid (need for PyPi)
deps = twine >= 1.12.1
pip >= 18.0.0
skip_install = true
extras =
commands = pip wheel -w {envtmpdir}/build --no-deps .
twine check {envtmpdir}/build/*
[testenv:bdist]
deps =
setuptools
wheel
skip_install = true
install_command =
# make sure we use the latest setuptools and wheel
pip install --upgrade {opts} {packages}
whitelist_externals =
rm
commands =
# clean up build/ and dist/ folders
python -c 'import shutil; shutil.rmtree("dist", ignore_errors=True)'
python setup.py clean --all
# build sdist
python setup.py sdist --dist-dir {toxinidir}/dist
# build wheel from sdist
pip wheel -v --no-deps --no-index --wheel-dir {toxinidir}/dist --find-links {toxinidir}/dist fonttools
[testenv:pypi]
deps =
{[testenv:bdist]deps}
twine
skip_install = true
passenv = TWINE_USERNAME TWINE_PASSWORD
commands =
{[testenv:bdist]commands}
twine upload dist/*.whl dist/*.zip