Skip to content

Commit

Permalink
tox: run py27,py35 envs by default; define a separate 'coverage' tox …
Browse files Browse the repository at this point in the history
…environment (useful for running it locally)
  • Loading branch information
Cosimo Lupo committed Nov 1, 2016
1 parent 2494eea commit 37835fc
Showing 1 changed file with 15 additions and 24 deletions.
39 changes: 15 additions & 24 deletions tox.ini
@@ -1,47 +1,38 @@
[tox]
envlist = py27, pypy, py34, py35
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)"
# run the test suite
py.test
# run the test suite against the package installed inside tox env
py.test {posargs:--pyargs defcon}

[testenv:coverage]
basepython = {env:TOXPYTHON:python3.5}
deps =
{[testenv]deps}
pytest-cov
skip_install = true
commands=
# measure test coverage and create html report
py.test --cov --cov-report html {posargs}

[testenv:coveralls]
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
basepython=python3.5
deps =
{[testenv]deps}
pytest-cov
{[testenv:coverage]deps}
coveralls
skip_install = true
ignore_outcome = true
commands=
# measure test coverage and upload report to coveralls
py.test --cov=Lib/defcon
py.test --cov
coveralls

[pytest]
minversion = 2.8
testpaths =
Lib/defcon
python_files =
test_*.py
python_classes =
*Test
addopts =
# run py.test in verbose mode
-v
# show extra test summary info
-r a

0 comments on commit 37835fc

Please sign in to comment.