Skip to content

Commit

Permalink
Use pytest instead of nose for running tests via tox
Browse files Browse the repository at this point in the history
  - use pytest-sugar for pretty output
  - add linting to each python tox environment
  - drop lint as separate tox target
  - replace travis_selector.sh with shell magic
  • Loading branch information
Dana Powers committed Jan 2, 2016
1 parent cb325af commit 1a6ff26
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 54 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dist
MANIFEST
env
servers/*/kafka-bin
.coverage
.coverage*
.noseids
docs/_build
.cache*
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ deploy:
# branch: master

script:
- if [ -n "$UNIT_AND_LINT_ONLY" ]; then tox -e lint,`./travis_selector.sh $TRAVIS_PYTHON_VERSION`; else tox -e `./travis_selector.sh $TRAVIS_PYTHON_VERSION`; fi
- tox -e ${TRAVIS_PYTHON_VERSION/./}

after_success:
- coveralls
43 changes: 9 additions & 34 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,48 +1,23 @@
[tox]
envlist = lint, py26, py27, pypy, py33, py34, py35, docs
envlist = py{26,27,py,33,34,35}, docs

[testenv]
deps =
nose
nose-timer
coverage
pytest
pytest-cov
pytest-catchlog
pytest-pylint
pytest-sugar
mock
python-snappy
py{26,27}: six
py26: unittest2
commands =
nosetests {posargs:-v -x --with-id --id-file={envdir}/.noseids --with-timer --timer-top-n 10 --with-coverage --cover-erase --cover-package kafka}
py.test {posargs:--pylint --pylint-rcfile=pylint.rc --pylint-error-types=EF --durations=10 --cov=kafka --doctest-modules kafka test}
setenv =
NOSE_LOGFORMAT = %(asctime)s - %(thread)d - %(name)s - %(levelname)s - %(message)s
PROJECT_ROOT = {toxinidir}
passenv = KAFKA_VERSION

[testenv:py26]
deps =
six
unittest2
nose
nose-timer
coverage
mock
python-snappy

[testenv:py27]
deps =
six
unittest2
nose
nose-timer
coverage
mock
python-snappy

[testenv:lint]
basepython = python2.7
deps =
unittest2
mock
pylint
commands = pylint --rcfile=pylint.rc {posargs: -E kafka test}

[testenv:docs]
deps =
sphinxcontrib-napoleon
Expand Down
18 changes: 0 additions & 18 deletions travis_selector.sh

This file was deleted.

0 comments on commit 1a6ff26

Please sign in to comment.