aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2013-08-14 17:56:08 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2013-08-14 17:56:08 +0200
commit1c24da23aea44e9f0be44c69d8650f63f0e7a841 (patch)
treefa905905dd062f4bf08132208e58bba3d64fa930
parent7e7abf17dd7459bd14ab3bd09720c22ccb86b42a (diff)
downloadfactory-boy-1c24da23aea44e9f0be44c69d8650f63f0e7a841.tar
factory-boy-1c24da23aea44e9f0be44c69d8650f63f0e7a841.tar.gz
More fixes to testsv2.1.2
-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()