Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #3 from tkaemming/master

Make the test runner work, add test command to README.
  • Loading branch information...
commit 176c69911691637c49b5ab9ad34c064bde1f4c7e 2 parents ec38ca7 + 2ad1655
@dcramer dcramer authored
Showing with 35 additions and 3 deletions.
  1. +2 −1  .gitignore
  2. +9 −1 README.rst
  3. +14 −0 runtests.py
  4. +10 −1 setup.py
View
3  .gitignore
@@ -1,4 +1,5 @@
*.pyc
+*.egg
*.egg-info/
/dist
-/build
+/build
View
10 README.rst
@@ -1 +1,9 @@
-A simple library for mocking certain Django behavior, such as the ORM.
+mock-django
+~~~~~~~~~~~
+
+A simple library for mocking certain Django behavior, such as the ORM.
+
+Testing
+-------
+
+``python setup.py test``
View
14 runtests.py
@@ -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()
View
11 setup.py
@@ -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.