Use py.test as test runner
This commit is contained in:
parent
9e967f7997
commit
2280a533c0
@ -12,12 +12,11 @@ flake8-import-order
|
|||||||
mock
|
mock
|
||||||
|
|
||||||
# Test runners
|
# Test runners
|
||||||
nose
|
pytest
|
||||||
|
pytest-cov
|
||||||
|
pytest-xdist
|
||||||
tox
|
tox
|
||||||
|
|
||||||
# Measure test's code coverage
|
|
||||||
coverage
|
|
||||||
|
|
||||||
# Check that MANIFEST.in matches Git repo contents before making a release
|
# Check that MANIFEST.in matches Git repo contents before making a release
|
||||||
check-manifest
|
check-manifest
|
||||||
|
|
||||||
|
|||||||
@ -89,11 +89,11 @@ Mopidy to come with tests.
|
|||||||
|
|
||||||
#. To run all tests, go to the project directory and run::
|
#. To run all tests, go to the project directory and run::
|
||||||
|
|
||||||
nosetests
|
py.test
|
||||||
|
|
||||||
To run tests with test coverage statistics::
|
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
|
Test coverage statistics can also be viewed online at
|
||||||
`coveralls.io <https://coveralls.io/r/mopidy/mopidy>`_.
|
`coveralls.io <https://coveralls.io/r/mopidy/mopidy>`_.
|
||||||
|
|||||||
@ -189,11 +189,6 @@ class that will connect the rest of the dots.
|
|||||||
'Pykka >= 1.1',
|
'Pykka >= 1.1',
|
||||||
'pysoundspot',
|
'pysoundspot',
|
||||||
],
|
],
|
||||||
test_suite='nose.collector',
|
|
||||||
tests_require=[
|
|
||||||
'nose',
|
|
||||||
'mock >= 1.0',
|
|
||||||
],
|
|
||||||
entry_points={
|
entry_points={
|
||||||
'mopidy.ext': [
|
'mopidy.ext': [
|
||||||
'soundspot = mopidy_soundspot:Extension',
|
'soundspot = mopidy_soundspot:Extension',
|
||||||
|
|||||||
5
setup.py
5
setup.py
@ -29,11 +29,6 @@ setup(
|
|||||||
'tornado >= 2.3',
|
'tornado >= 2.3',
|
||||||
],
|
],
|
||||||
extras_require={'http': []},
|
extras_require={'http': []},
|
||||||
test_suite='nose.collector',
|
|
||||||
tests_require=[
|
|
||||||
'nose',
|
|
||||||
'mock >= 1.0',
|
|
||||||
],
|
|
||||||
entry_points={
|
entry_points={
|
||||||
'console_scripts': [
|
'console_scripts': [
|
||||||
'mopidy = mopidy.__main__:main',
|
'mopidy = mopidy.__main__:main',
|
||||||
|
|||||||
6
tasks.py
6
tasks.py
@ -15,11 +15,9 @@ def test(path=None, coverage=False, watch=False, warn=False):
|
|||||||
if watch:
|
if watch:
|
||||||
return watcher(test, path=path, coverage=coverage)
|
return watcher(test, path=path, coverage=coverage)
|
||||||
path = path or 'tests/'
|
path = path or 'tests/'
|
||||||
cmd = 'nosetests'
|
cmd = 'py.test'
|
||||||
if coverage:
|
if coverage:
|
||||||
cmd += (
|
cmd += ' --cov=mopidy --cov-report=term-missing'
|
||||||
' --with-coverage --cover-package=mopidy'
|
|
||||||
' --cover-branches --cover-html')
|
|
||||||
cmd += ' %s' % path
|
cmd += ' %s' % path
|
||||||
run(cmd, pty=True, warn=warn)
|
run(cmd, pty=True, warn=warn)
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
from __future__ import absolute_import, unicode_literals
|
|
||||||
|
|
||||||
import nose
|
|
||||||
|
|
||||||
nose.main()
|
|
||||||
10
tox.ini
10
tox.ini
@ -3,20 +3,20 @@ envlist = py27, py27-tornado23, py27-tornado31, docs, flake8
|
|||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
sitepackages = true
|
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 =
|
deps =
|
||||||
coverage
|
|
||||||
mock
|
mock
|
||||||
nose
|
pytest
|
||||||
|
pytest-cov
|
||||||
|
|
||||||
[testenv:py27-tornado23]
|
[testenv:py27-tornado23]
|
||||||
commands = nosetests -v tests/http
|
commands = py.test tests/http
|
||||||
deps =
|
deps =
|
||||||
{[testenv]deps}
|
{[testenv]deps}
|
||||||
tornado==2.3
|
tornado==2.3
|
||||||
|
|
||||||
[testenv:py27-tornado31]
|
[testenv:py27-tornado31]
|
||||||
commands = nosetests -v tests/http
|
commands = py.test tests/http
|
||||||
deps =
|
deps =
|
||||||
{[testenv]deps}
|
{[testenv]deps}
|
||||||
tornado==3.1.1
|
tornado==3.1.1
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user