diff --git a/dev-requirements.txt b/dev-requirements.txt index 7b0e96c8..eba66348 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -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 diff --git a/docs/contributing.rst b/docs/contributing.rst index 165fee49..f30e16bd 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -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 `_. diff --git a/docs/extensiondev.rst b/docs/extensiondev.rst index c6a88619..93f627dc 100644 --- a/docs/extensiondev.rst +++ b/docs/extensiondev.rst @@ -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', diff --git a/setup.py b/setup.py index 384aaec5..0d29c041 100644 --- a/setup.py +++ b/setup.py @@ -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', diff --git a/tasks.py b/tasks.py index 7b5692e3..9353eb8a 100644 --- a/tasks.py +++ b/tasks.py @@ -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) diff --git a/tests/__main__.py b/tests/__main__.py deleted file mode 100644 index ae7a18e6..00000000 --- a/tests/__main__.py +++ /dev/null @@ -1,5 +0,0 @@ -from __future__ import absolute_import, unicode_literals - -import nose - -nose.main() diff --git a/tox.ini b/tox.ini index 277ae9d3..3d48e311 100644 --- a/tox.ini +++ b/tox.ini @@ -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