aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AUTHORS.rst1
-rw-r--r--setup.py24
2 files changed, 24 insertions, 1 deletions
diff --git a/AUTHORS.rst b/AUTHORS.rst
index e9c2f85f..c06faf1a 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -15,3 +15,4 @@ PGP key fingerprints are enclosed in parentheses.
* Konstantinos Koukopoulos <koukopoulos@gmail.com> (D6BD 52B6 8C99 A91C E2C8 934D 3300 566B 3A46 726E)
* Stephen Holsapple <sholsapp@gmail.com>
* Terry Chia <terrycwk1994@gmail.com>
+* Matthew Iversen <matt@notevencode.com> (2F04 3DCC D6E6 D5AC D262 2E0B C046 E8A8 7452 2973)
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,
}
)