From 2f5ffb3a88dfc51604ef9f1ee3b89d79733ea311 Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Sat, 1 Feb 2014 00:12:11 -0800 Subject: [PATCH] switch test framework to use py.test instead of nose --- .travis.yml | 3 ++- pywb/utils.py | 8 +++++--- setup.py | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8c597ba7..618a7426 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,4 +5,5 @@ python: install: - "python setup.py -q install" # command to run tests -script: nosetests --with-doctest +#script: nosetests --with-doctest +script: py.test run-tests.py ./pywb/ --doctest-modules --ignore=setup.py diff --git a/pywb/utils.py b/pywb/utils.py index 3a8cba4e..9041db09 100644 --- a/pywb/utils.py +++ b/pywb/utils.py @@ -224,14 +224,16 @@ def unsurt(surt): #================================================================= -# Support for bulk doctest testing via nose +# Support for bulk doctest testing via nose or py.test # nosetests --with-doctest +# py.test --doctest_modules import sys -is_in_nose = sys.argv[0].endswith('nosetests') +is_in_testtool = any(sys.argv[0].endswith(tool) for tool in ['py.test', 'nosetests']) def enable_doctests(): - return is_in_nose + return is_in_testtool + def test_data_dir(): import os diff --git a/setup.py b/setup.py index 969c2d0d..7e91217a 100755 --- a/setup.py +++ b/setup.py @@ -12,6 +12,6 @@ setuptools.setup(name='pywb', license='GPL', packages=['pywb'], install_requires=['uwsgi', 'rfc3987', 'chardet', 'redis', 'jinja2', 'surt', 'pyyaml', 'WebTest'], - # test_suite='?', # not sure how to run doctests here + tests_require['WebTest', 'pytest'], zip_safe=False)