Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
super awesome test running - thanks carl
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env python | ||
|
||
from os.path import dirname, abspath | ||
import sys | ||
|
||
from django.conf import settings as django_settings | ||
|
||
if not django_settings.configured: | ||
django_settings.configure( | ||
DATABASE_ENGINE="sqlite3", | ||
INSTALLED_APPS=( | ||
"django.contrib.sessions", | ||
"django.contrib.contenttypes", | ||
"django.contrib.auth", | ||
"agon", | ||
), | ||
) | ||
|
||
def runtests(*test_args): | ||
if not test_args: | ||
test_args = ["agon"] | ||
parent = dirname(abspath(__file__)) | ||
sys.path.insert(0, parent) | ||
from django.test.simple import run_tests | ||
failures = run_tests(test_args, verbosity=1, interactive=True) | ||
sys.exit(failures) | ||
|
||
|
||
if __name__ == "__main__": | ||
runtests(*sys.argv[1:]) |
367b5ce
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FTR, I wrote http://github.com/brosner/django-app-test-runner to make this even easier.
367b5ce
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool. did not know about that. will check it out for sure. better than copying this script around everywhere.
367b5ce
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I've looked at app-test-runner and used it some. For open-source apps, I prefer to have something obvious in the repo that anyone cloning it will see and can use immediately, without having to read the docs or download some other tool.