Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make `python setup.py test` and `runtests.py` work.

  • Loading branch information...
commit b973952e9d79b1a20d4a4ef19b978fbb987af94b 1 parent ec38ca7
ted kaemming tkaemming authored
Showing with 24 additions and 1 deletion.
  1. +14 −0 runtests.py
  2. +10 −1 setup.py
14 runtests.py
View
@@ -0,0 +1,14 @@
+#!/usr/bin/env python
+from django.conf import settings
+from nose.core import collector, run
+
+
+# Trick Django into thinking that we've configured a project, so importing
+# anything that tries to access attributes of `django.conf.settings` will just
+# return the default values, instead of crashing out.
+if not settings.configured:
+ settings.configure()
+
+
+if __name__ == '__main__':
+ run()
11 setup.py
View
@@ -1,5 +1,14 @@
from setuptools import setup, find_packages
+# Hack to prevent stupid "TypeError: 'NoneType' object is not callable" error
+# in multiprocessing/util.py _exit_function when running `python
+# setup.py test` (see
+# http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html)
+try:
+ import multiprocessing
+except ImportError:
+ pass
+
setup(
name='mock-django',
version='0.6.1',
@@ -14,7 +23,7 @@
'unittest2',
'mock',
],
- test_suite='nose.collector',
+ test_suite='runtests.collector',
zip_safe=False,
include_package_data=True,
)
Please sign in to comment.
Something went wrong with that request. Please try again.