File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 1313from django .test .utils import get_runner
1414
1515
16- def runtests (test_labels = None ):
16+ def setup_and_run_tests (test_labels = None ):
1717 """Discover and run project tests. Returns number of failures."""
1818 test_labels = test_labels or ['tests' ]
1919
20+ warnings .simplefilter ('default' ) # show DeprecationWarning and other default-ignored warnings
21+
2022 # noinspection PyStringFormat
2123 os .environ ['DJANGO_SETTINGS_MODULE' ] = \
2224 'tests.test_settings.settings_%d_%d' % django .VERSION [:2 ]
@@ -27,7 +29,12 @@ def runtests(test_labels=None):
2729 return test_runner .run_tests (test_labels )
2830
2931
30- if __name__ == '__main__' :
31- warnings .simplefilter ('default' ) # show DeprecationWarning and other default-ignored warnings
32- failures = runtests (test_labels = sys .argv [1 :])
32+ def runtests (test_labels = None ):
33+ """Run project tests and exit"""
34+ # Used as setup test_suite: must either exit or return a TestSuite
35+ failures = setup_and_run_tests (test_labels )
3336 sys .exit (bool (failures ))
37+
38+
39+ if __name__ == '__main__' :
40+ runtests (test_labels = sys .argv [1 :])
You can’t perform that action at this time.
0 commit comments