Use py.test as test runner

This commit is contained in:
Stein Magnus Jodal 2015-03-05 00:35:20 +01:00
parent 9e967f7997
commit 2280a533c0
7 changed files with 12 additions and 30 deletions

View File

@ -12,12 +12,11 @@ flake8-import-order
mock
# Test runners
nose
pytest
pytest-cov
pytest-xdist
tox
# Measure test's code coverage
coverage
# Check that MANIFEST.in matches Git repo contents before making a release
check-manifest

View File

@ -89,11 +89,11 @@ Mopidy to come with tests.
#. To run all tests, go to the project directory and run::
nosetests
py.test
To run tests with test coverage statistics::
nosetests --with-coverage
py.test --cov=mopidy --cov-report=term-missing
Test coverage statistics can also be viewed online at
`coveralls.io <https://coveralls.io/r/mopidy/mopidy>`_.

View File

@ -189,11 +189,6 @@ class that will connect the rest of the dots.
'Pykka >= 1.1',
'pysoundspot',
],
test_suite='nose.collector',
tests_require=[
'nose',
'mock >= 1.0',
],
entry_points={
'mopidy.ext': [
'soundspot = mopidy_soundspot:Extension',

View File

@ -29,11 +29,6 @@ setup(
'tornado >= 2.3',
],
extras_require={'http': []},
test_suite='nose.collector',
tests_require=[
'nose',
'mock >= 1.0',
],
entry_points={
'console_scripts': [
'mopidy = mopidy.__main__:main',

View File

@ -15,11 +15,9 @@ def test(path=None, coverage=False, watch=False, warn=False):
if watch:
return watcher(test, path=path, coverage=coverage)
path = path or 'tests/'
cmd = 'nosetests'
cmd = 'py.test'
if coverage:
cmd += (
' --with-coverage --cover-package=mopidy'
' --cover-branches --cover-html')
cmd += ' --cov=mopidy --cov-report=term-missing'
cmd += ' %s' % path
run(cmd, pty=True, warn=warn)

View File

@ -1,5 +0,0 @@
from __future__ import absolute_import, unicode_literals
import nose
nose.main()

10
tox.ini
View File

@ -3,20 +3,20 @@ envlist = py27, py27-tornado23, py27-tornado31, docs, flake8
[testenv]
sitepackages = true
commands = nosetests -v --with-xunit --xunit-file=xunit-{envname}.xml --with-coverage --cover-package=mopidy
commands = py.test --junit-xml=xunit-{envname}.xml --cov=mopidy
deps =
coverage
mock
nose
pytest
pytest-cov
[testenv:py27-tornado23]
commands = nosetests -v tests/http
commands = py.test tests/http
deps =
{[testenv]deps}
tornado==2.3
[testenv:py27-tornado31]
commands = nosetests -v tests/http
commands = py.test tests/http
deps =
{[testenv]deps}
tornado==3.1.1