Commit 490a4b86c65243a7517c29ba167afe68dcb1c2cc
Committed by
Sergio Oliveira
1 parent
b7b8f9d3
Exists in
master
and in
39 other branches
Script of test with coverage.
Signed-off-by: Matheus Fernandes <matheus.fernandes@gmail.com> Signed-off-by: Sergio Oliveira <sergio@tracy.com.br>
Showing
3 changed files
with
27 additions
and
5 deletions
Show diff stats
requirements_test.txt
... | ... | @@ -0,0 +1,26 @@ |
1 | +#!/usr/bin/env python | |
2 | + | |
3 | +import os | |
4 | + | |
5 | +os.environ['DJANGO_SETTINGS_MODULE'] = 'colab.tests.settings' | |
6 | +os.environ['COVERAGE_PROCESS_START'] = '.coveragerc' | |
7 | +os.environ['REUSE_DB'] = '0' | |
8 | + | |
9 | +import django | |
10 | +import coverage | |
11 | + | |
12 | +from django.test.utils import get_runner | |
13 | +from django.conf import settings | |
14 | + | |
15 | + | |
16 | +def runtests(): | |
17 | + if django.VERSION >= (1, 7, 0): | |
18 | + django.setup() | |
19 | + test_runner = get_runner(settings) | |
20 | + failures = test_runner(interactive=False, failfast=False).run_tests([]) | |
21 | + sys.exit(failures) | |
22 | + | |
23 | + | |
24 | +if __name__ == '__main__': | |
25 | + coverage.process_startup() | |
26 | + runtests() | ... | ... |