Debian Codegraph @

runtests.py

raw symbols SCIP
1 #!/usr/bin/env python
2 import os
3 import sys
4 import warnings
5
6 import django
7 from django.core.management import execute_from_command_line
8
9 parent = os.path.dirname(os.path.abspath(__file__))
10 sys.path.insert(0, parent)
11
12 DEFAULT_TEST_APPS = [
13 'sortedm2m_tests',
14 ]
15
16
17 def runtests(*args):
18 warnings.filterwarnings("ignore", module="distutils")
19
20 # Ignore a python 3.6 DeprecationWarning in ModelBase.__new__ that isn't
21 # fixed in Django 1.x
22 if sys.version_info > (3, 6) and django.VERSION < (2,):
23 warnings.filterwarnings(
24 "ignore", "__class__ not set defining", DeprecationWarning)
25
26 test_apps = list(args or DEFAULT_TEST_APPS)
27 print([sys.argv[0], 'test', '--verbosity=1'] + test_apps)
28 execute_from_command_line([sys.argv[0], 'test', '--verbosity=1'] + test_apps)
29
30
31 if __name__ == '__main__':
32 runtests(*sys.argv[1:])