# HG changeset patch # User Thomas De Schampheleire # Date 1454535148 -3600 # Node ID d88077fae3d61ef0a50928e20280cbb6a4a24fb3 # Parent 6a83b399bb3ccd5cf282beb42061e64a787f9cd7 pytest migration: switch to pytest; remove nose support Make pytest the default test runner and remove support for nose. Tests can be run using: - py.test - python setup.py test The pytest configuration needs to move from setup.cfg to pytest.ini to support this - see https://github.com/pytest-dev/pytest/issues/567 and https://bitbucket.org/pytest-dev/pytest-runner/issues/7/support-all-pytest-commands . diff -r 6a83b399bb3c -r d88077fae3d6 kallithea/tests/parameterized.py --- a/kallithea/tests/parameterized.py Wed Feb 03 22:14:36 2016 +0100 +++ b/kallithea/tests/parameterized.py Wed Feb 03 22:32:28 2016 +0100 @@ -10,13 +10,6 @@ def skip_test(func): try: - from nose.tools import nottest - except ImportError: - pass - else: - func = nottest(func) - - try: import pytest except ImportError: pass diff -r 6a83b399bb3c -r d88077fae3d6 pytest.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pytest.ini Wed Feb 03 22:32:28 2016 +0100 @@ -0,0 +1,9 @@ +[pytest] +# only look for tests in kallithea/tests +python_files = kallithea/tests/**/test_*.py +addopts = + # --verbose + # show extra test summary info as specified by chars (f)ailed, (E)error, (s)skipped, (x)failed, (X)passed, (w)warnings. + -rfEsxXw + # Shorter scrollbacks; less stuff to scroll through + --tb=short diff -r 6a83b399bb3c -r d88077fae3d6 setup.cfg --- a/setup.cfg Wed Feb 03 22:14:36 2016 +0100 +++ b/setup.cfg Wed Feb 03 22:32:28 2016 +0100 @@ -3,22 +3,8 @@ tag_svn_revision = 0 tag_date = 0 -[nosetests] -verbose = True -verbosity = 2 -with-pylons = kallithea/tests/test.ini -detailed-errors = 1 -nologcapture = 1 - -[pytest] -# only look for tests in kallithea/tests -python_files = kallithea/tests/**/test_*.py -addopts = - # --verbose - # show extra test summary info as specified by chars (f)ailed, (E)error, (s)skipped, (x)failed, (X)passed, (w)warnings. - -rfEsxXw - # Shorter scrollbacks; less stuff to scroll through - --tb=short +[aliases] +test = pytest [compile_catalog] domain = kallithea diff -r 6a83b399bb3c -r d88077fae3d6 setup.py --- a/setup.py Wed Feb 03 22:14:36 2016 +0100 +++ b/setup.py Wed Feb 03 22:32:28 2016 +0100 @@ -54,6 +54,7 @@ "mock", "URLObject==2.3.4", "Routes==1.13", + "pytest>=2.7.0,<3.0", "dulwich>=0.9.9,<=0.9.9", "mercurial>=2.9,<3.7", ] @@ -147,11 +148,12 @@ url=__url__, install_requires=requirements, classifiers=classifiers, - setup_requires=["PasteScript>=1.6.3"], + setup_requires=['PasteScript>=1.6.3', + 'pytest-runner'], + tests_require=['pytest'], data_files=data_files, packages=packages, include_package_data=True, - test_suite='nose.collector', package_data=package_data, message_extractors={'kallithea': [ ('**.py', 'python', None), @@ -184,8 +186,5 @@ upgrade-db=kallithea.lib.dbmigrate:UpgradeDb celeryd=kallithea.lib.celerypylons.commands:CeleryDaemonCommand install-iis=kallithea.lib.paster_commands.install_iis:Command - - [nose.plugins] - pylons = pylons.test:PylonsPlugin """, )