Skip to content

Commit

Permalink
super awesome test running - thanks carl
Browse files Browse the repository at this point in the history
  • Loading branch information
paltman committed Oct 30, 2010
1 parent 947bd62 commit 367b5ce
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions runtests.py
@@ -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:])

3 comments on commit 367b5ce

@brosner
Copy link
Member

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.

@paltman
Copy link
Member Author

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.

@carljm
Copy link
Contributor

@carljm carljm commented on 367b5ce Nov 1, 2010

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.

Please sign in to comment.