From ae3a039d95bce8aa78d9568a8924c9b08519ff70 Mon Sep 17 00:00:00 2001 From: Kelsey Hawley Date: Fri, 17 Jan 2014 12:13:39 -0800 Subject: [PATCH] updated setup.py to use pytest (for compatilibity with dump-anydbm tests) --- setup.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index dabce13..c657ec9 100755 --- a/setup.py +++ b/setup.py @@ -1,8 +1,23 @@ #!/usr/bin/env python # vim: set sw=4 et: +from setuptools.command.test import test as TestCommand +import sys import setuptools +# special class needs to be added to support the pytest written dump-anydbm tests +class PyTest(TestCommand): + def finalize_options(self): + TestCommand.finalize_options(self) + self.test_args = [] + self.test_suite = True + def run_tests(self): + #import here, cause outside the eggs aren't loaded + import pytest + errno = pytest.main(self.test_args) + sys.exit(errno) + + setuptools.setup(name='warcprox', version='1.1', description='WARC writing MITM HTTP/S proxy', @@ -14,7 +29,8 @@ setuptools.setup(name='warcprox', packages=['warcprox'], install_requires=['pyopenssl', 'warctools>=4.8.3'], # gdbm not in pip :( dependency_links=['git+https://github.com/internetarchive/warctools.git#egg=warctools-4.8.3'], - tests_require=['requests>=2.0.1'], # >=2.0.1 for https://github.com/kennethreitz/requests/pull/1636 + tests_require=['requests>=2.0.1', 'pytest'], # >=2.0.1 for https://github.com/kennethreitz/requests/pull/1636 + cmdclass = {'test': PyTest}, test_suite='warcprox.tests', scripts=['bin/dump-anydbm', 'bin/warcprox'], zip_safe=False,