diff --git a/setup.py b/setup.py index b98439ccddb88f02ee176a8a81fd5510a611e57d..3e4ab38aacef40800704c5ce4a4022e67b124eba 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,7 @@ #!/usr/bin/env python from setuptools import setup +from setuptools.command.test import test as TestCommand +import sys __about__ = {} @@ -17,6 +19,18 @@ else: ext_modules = [nacl.nacl.ffi.verifier.get_extension()] +class PyTest(TestCommand): + def finalize_options(self): + TestCommand.finalize_options(self) + self.test_args = [] + self.test_suite = True + + def run_tests(self): + import pytest + errno = pytest.main(self.test_args) + sys.exit(errno) + + setup( name=__about__["__title__"], version=__about__["__version__"], @@ -45,4 +59,5 @@ setup( ext_modules=ext_modules, zip_safe=False, + cmdclass = {'test': PyTest}, )