diff options
author | Adam Bogdał <adam@bogdal.pl> | 2015-07-03 15:44:39 +0200 |
---|---|---|
committer | Adam Bogdał <adam@bogdal.pl> | 2015-07-03 15:44:39 +0200 |
commit | 948626104ce9a1d7e9dea203efc3ab6645a266e3 (patch) | |
tree | fdd39a07853825ef7f90703acf502085422200ce /setup.py | |
parent | a8910046170a6ab310942f1fbd39afa0c5cb46ab (diff) | |
download | django-payments-taler-948626104ce9a1d7e9dea203efc3ab6645a266e3.tar.gz django-payments-taler-948626104ce9a1d7e9dea203efc3ab6645a266e3.tar.bz2 django-payments-taler-948626104ce9a1d7e9dea203efc3ab6645a266e3.zip |
Start using tox and pytest
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 31 |
1 files changed, 29 insertions, 2 deletions
@@ -1,6 +1,8 @@ #!/usr/bin/env python from setuptools import setup +from setuptools.command.test import test as TestCommand import os +import sys os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'test_settings') @@ -27,6 +29,26 @@ REQUIREMENTS = [ 'suds-jurko>=0.6', 'xmltodict>=0.9.2'] + +class PyTest(TestCommand): + user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")] + + def initialize_options(self): + TestCommand.initialize_options(self) + self.pytest_args = [] + + 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.pytest_args) + sys.exit(errno) + + setup( name='django-payments', author='Mirumee Software', @@ -49,6 +71,11 @@ setup( 'Topic :: Software Development :: Libraries :: Application Frameworks', 'Topic :: Software Development :: Libraries :: Python Modules'], install_requires=REQUIREMENTS, - tests_require=['mock'], - test_suite='payments.tests', + cmdclass={ + 'test': PyTest}, + tests_require=[ + 'mock', + 'pytest', + 'pytest-django' + ], zip_safe=False) |