allow to specify single test in runtests.py
import os
import sys
import warnings
+from optparse import OptionParser
import django
from django.conf import settings
from django.core.management import call_command
-def runtests():
+def runtests(test_path='modeltranslation'):
if not settings.configured:
# Choose database for settings
DATABASES = {
@@ -49,10 +50,13 @@ def runtests():
django.setup()
warnings.simplefilter('always', DeprecationWarning)
failures = call_command(
- 'test', 'modeltranslation', interactive=False, failfast=False, verbosity=2)
+ 'test', test_path, interactive=False, failfast=False, verbosity=2)
sys.exit(bool(failures))
if __name__ == '__main__':
- runtests()
+ parser = OptionParser()
+
+ (options, args) = parser.parse_args()
+ runtests(*args)
