diff options
-rw-r--r-- | setup.py | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -14,7 +14,7 @@ import os from distutils.command.build import build from setuptools import setup, find_packages - +from setuptools.command.test import test as TestCommand base_dir = os.path.dirname(__file__) @@ -31,6 +31,12 @@ requirements = [ SIX_DEPENDENCY ] +test_requirements = [ + "pytest", + "pretend", + "iso8601" +] + class CFFIBuild(build): """ @@ -63,6 +69,17 @@ class CFFIBuild(build): build.finalize_options(self) +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) + with open(os.path.join(base_dir, "README.rst")) as f: long_description = f.read() @@ -105,11 +122,13 @@ setup( install_requires=requirements, setup_requires=requirements, + tests_require=test_requirements, # for cffi zip_safe=False, ext_package="cryptography", cmdclass={ "build": CFFIBuild, + "test": PyTest, } ) |