mirror of
https://github.com/Hopiu/django-modeltranslation.git
synced 2026-05-04 11:34:42 +00:00
allow to specify single test in runtests.py
This commit is contained in:
parent
0f67f39e34
commit
5cda246b90
1 changed files with 7 additions and 3 deletions
10
runtests.py
10
runtests.py
|
|
@ -2,13 +2,14 @@
|
|||
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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue