summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsetup.py10
-rw-r--r--tests/test_django.py2
2 files changed, 11 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index f9c2844..1b49342 100755
--- a/setup.py
+++ b/setup.py
@@ -3,6 +3,7 @@
import os
import re
+import sys
from setuptools import setup
@@ -21,6 +22,11 @@ def get_version(package_name):
return '0.1.0'
+if sys.version_info[0:2] < (2, 7): # pragma: no cover
+ test_loader = 'unittest2:TestLoader'
+else:
+ test_loader = 'unittest:TestLoader'
+
PACKAGE = 'factory'
@@ -40,6 +46,9 @@ setup(
setup_requires=[
'setuptools>=0.8',
],
+ tests_require=[
+ 'mock',
+ ],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
@@ -58,4 +67,5 @@ setup(
'Topic :: Software Development :: Libraries :: Python Modules'
],
test_suite='tests',
+ test_loader=test_loader,
)
diff --git a/tests/test_django.py b/tests/test_django.py
index 5335a94..9d02131 100644
--- a/tests/test_django.py
+++ b/tests/test_django.py
@@ -74,7 +74,7 @@ test_state = {}
def setUpModule():
if django is None: # pragma: no cover
- return
+ raise unittest.SkipTest("Django not installed")
django_test_utils.setup_test_environment()
runner = django_test_simple.DjangoTestSuiteRunner()
runner_state = runner.setup_databases()