aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-02-25 07:15:34 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2014-02-25 07:15:34 -0800
commiteaf9a80399dabb05304b315181e48de48c66008a (patch)
treedbd5a5eb6ec08bf966f554d84e21872390c2712d
parentad5862ea94640197efc05d38afa6347ebf299b4f (diff)
parent066718022e8cb1c9e6326d944c99280905ad0a82 (diff)
downloadcryptography-eaf9a80399dabb05304b315181e48de48c66008a.tar.gz
cryptography-eaf9a80399dabb05304b315181e48de48c66008a.tar.bz2
cryptography-eaf9a80399dabb05304b315181e48de48c66008a.zip
Merge pull request #678 from koobs/patch-1
Integrate py.test enabling `python setup.py test`
-rw-r--r--setup.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index a2a75504..681b9031 100644
--- a/setup.py
+++ b/setup.py
@@ -11,10 +11,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
+import sys
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 +32,12 @@ requirements = [
SIX_DEPENDENCY
]
+test_requirements = [
+ "pytest",
+ "pretend",
+ "iso8601"
+]
+
class CFFIBuild(build):
"""
@@ -64,6 +71,19 @@ 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 because in module scope the eggs are not 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 +125,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,
}
)