Changeset - 4046891cb5a0
[Approved]
default
0 3 1
Thomas De Schampheleire (patrickdp) - 9 years ago 2016-02-03 21:32:28
thomas.de.schampheleire@gmail.com
Replaced by: d88077fae3d6
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 to pytest.ini to support this.
4 files changed with 15 insertions and 28 deletions:
3 comments (0 inline, 3 general) First comment
kallithea/tests/parameterized.py
Show inline comments
 
@@ -10,13 +10,6 @@ from unittest import TestCase
 

	
 
def skip_test(func):
 
    try:
 
        from nose.tools import nottest
 
    except ImportError:
 
        pass
 
    else:
 
        func = nottest(func)
 

	
 
    try:
 
        import pytest
 
    except ImportError:
 
        pass
pytest.ini
Show inline comments
 
new file 100644
 
[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
setup.cfg
Show inline comments
 
@@ -3,22 +3,8 @@ tag_build =
 
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
setup.py
Show inline comments
 
@@ -56,6 +56,7 @@ requirements = [
 
    "Routes==1.13",
 
    "dulwich>=0.9.9,<=0.9.9",
 
    "mercurial>=2.9,<3.7",
 
    "pytest>=2.7.0,<3.0",
 
]
 

	
 
if sys.version_info < (2, 7):
 
@@ -147,11 +148,12 @@ setup(
 
    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 @@ setup(
 
    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
 
    """,
 
)
3 comments (0 inline, 3 general) First comment
Thomas De Schampheleire (patrickdp) 9 years and 2 months ago comment on pull request "finalize pytest migration"

Status change: Under review

Søren Løvborg (kwi) 9 years and 2 months ago on this changeset

Status change: Approved

Søren Løvborg (kwi) 9 years and 2 months ago comment on pull request "finalize pytest migration"

Status change: Approved

You need to be logged in to comment. Login now