mirror of
https://github.com/jazzband/django-admin2.git
synced 2026-03-30 04:50:24 +00:00
Allow runtests.py to take positional arguments to specify only a subset of tests that should be run.
This commit is contained in:
parent
0092325262
commit
d4eb1e4bd3
1 changed files with 8 additions and 3 deletions
11
runtests.py
11
runtests.py
|
|
@ -10,11 +10,16 @@ from django.test.utils import get_runner
|
|||
from django.conf import settings
|
||||
|
||||
|
||||
def runtests():
|
||||
def runtests(tests=('blog', 'djadmin2',)):
|
||||
TestRunner = get_runner(settings)
|
||||
test_runner = TestRunner(verbosity=1, interactive=True)
|
||||
failures = test_runner.run_tests(['blog', 'djadmin2'])
|
||||
failures = test_runner.run_tests(tests)
|
||||
sys.exit(bool(failures))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
runtests()
|
||||
if len(sys.argv) > 1:
|
||||
tests = sys.argv[1:]
|
||||
runtests(tests)
|
||||
else:
|
||||
runtests()
|
||||
|
|
|
|||
Loading…
Reference in a new issue