When running `tox` command without specifying any `-e` option, or when no $TOXENV environment variable is specified, the 'envlist' in tox.ini file determines the list of environment tox will operate on. http://tox.readthedocs.io/en/latest/config.html#confval-envlist=CSV I chose Python 2.7 and 3.5 because I assume they are the versions that other fonttols developers run their tests on locally, before pushing and let the CI run the tests on the rest of the pythons.
54 lines
1.3 KiB
INI
54 lines
1.3 KiB
INI
[tox]
|
|
envlist = py27, py35
|
|
|
|
[testenv]
|
|
basepython =
|
|
py27: {env:TOXPYTHON:python2.7}
|
|
pypy: {env:TOXPYTHON:pypy}
|
|
py34: {env:TOXPYTHON:python3.4}
|
|
py35: {env:TOXPYTHON:python3.5}
|
|
deps =
|
|
pytest
|
|
-rrequirements.txt
|
|
install_command =
|
|
{envpython} -m pip install -v {opts} {packages}
|
|
commands =
|
|
# check that we have the expected Python version and architecture
|
|
{envpython} -c "import sys; print(sys.version)"
|
|
{envpython} -c "import struct; print(struct.calcsize('P') * 8)"
|
|
# run the test suite
|
|
py.test
|
|
|
|
[testenv:coveralls]
|
|
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
|
|
basepython=python3.5
|
|
deps =
|
|
{[testenv]deps}
|
|
pytest-cov
|
|
coveralls
|
|
skip_install = true
|
|
ignore_outcome = true
|
|
commands=
|
|
# measure test coverage and upload report to coveralls
|
|
py.test --cov
|
|
coveralls
|
|
|
|
[pytest]
|
|
minversion = 2.8
|
|
testpaths =
|
|
Lib/fontTools
|
|
python_files =
|
|
*_test.py
|
|
python_classes =
|
|
*Test
|
|
addopts =
|
|
# run py.test in verbose mode
|
|
-v
|
|
# show extra test summary info
|
|
-r a
|
|
# run doctests in all .py modules
|
|
--doctest-modules
|
|
# py.test raises ImportError with inspect.py (requires pygtk) and with
|
|
# reportLabPen.py (reportlab). They don't have doctests, it's OK to skip.
|
|
--doctest-ignore-import-errors
|