forked from zbyte64/django-configstore
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged head from zbyte64/django-configstore to webcube/django-configs…
…tore to add new test fixes.
- Loading branch information
apires
committed
Mar 7, 2013
1 parent
0edf7dd
commit 3c7c552
Showing
6 changed files
with
64 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,33 @@ | ||
import os, sys | ||
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' | ||
test_dir = os.path.dirname(__file__) | ||
sys.path.insert(0, test_dir) | ||
""" | ||
Test support harness for doing setup.py test. | ||
See http://ericholscher.com/blog/2009/jun/29/enable-setuppy-test-your-django-apps/. | ||
""" | ||
import sys | ||
|
||
from django.test.simple import run_tests as django_test_runner | ||
import os | ||
|
||
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.test_settings' | ||
|
||
# Bootstrap Django's settings. | ||
from django.conf import settings | ||
settings.DATABASES = { | ||
'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory;'} | ||
} | ||
settings.TEST_RUNNER = "django_nose.NoseTestSuiteRunner" | ||
|
||
def runtests(): | ||
failures = django_test_runner(['configstore'], verbosity=1, interactive=True) | ||
sys.exit(failures) | ||
"""Test runner for setup.py test.""" | ||
# Run you some tests. | ||
import django.test.utils | ||
runner_class = django.test.utils.get_runner(settings) | ||
test_runner = runner_class(verbosity=1, interactive=True) | ||
failures = test_runner.run_tests(['configstore']) | ||
|
||
if __name__ == '__main__': | ||
runtests() | ||
# Okay, so this is a nasty hack. If this isn't here, `setup.py test` craps out | ||
# when generating a coverage report via Nose. I have no idea why, or what's | ||
# supposed to be going on here, but this seems to fix the problem, and I | ||
# *really* want coverage, so, unless someone can tell me *why* I shouldn't | ||
# do this, I'm going to just whistle innocently and keep on doing this. | ||
sys.exitfunc = lambda: 0 | ||
|
||
sys.exit(failures) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters