From 9e565386d3fafc8cc15d07095e50d574e5f53802 Mon Sep 17 00:00:00 2001 From: Baptiste Mispelon Date: Sat, 30 Nov 2019 22:10:16 +0100 Subject: Fixed #27430 -- Added -b/--buffer option to DiscoverRunner. --- tests/runtests.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests/runtests.py') diff --git a/tests/runtests.py b/tests/runtests.py index 293396f96c..1282538a6d 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -281,7 +281,7 @@ class ActionSelenium(argparse.Action): def django_tests(verbosity, interactive, failfast, keepdb, reverse, test_labels, debug_sql, parallel, tags, exclude_tags, - test_name_patterns, start_at, start_after, pdb): + test_name_patterns, start_at, start_after, pdb, buffer): state = setup(verbosity, test_labels, parallel, start_at, start_after) extra_tests = [] @@ -302,6 +302,7 @@ def django_tests(verbosity, interactive, failfast, keepdb, reverse, exclude_tags=exclude_tags, test_name_patterns=test_name_patterns, pdb=pdb, + buffer=buffer, ) failures = test_runner.run_tests( test_labels or get_installed(), @@ -497,6 +498,10 @@ if __name__ == "__main__": '--pdb', action='store_true', help='Runs the PDB debugger on error or failure.' ) + parser.add_argument( + '-b', '--buffer', action='store_true', + help='Discard output of passing tests.', + ) if PY37: parser.add_argument( '-k', dest='test_name_patterns', action='append', @@ -563,7 +568,7 @@ if __name__ == "__main__": options.debug_sql, options.parallel, options.tags, options.exclude_tags, getattr(options, 'test_name_patterns', None), - options.start_at, options.start_after, options.pdb, + options.start_at, options.start_after, options.pdb, options.buffer, ) if failures: sys.exit(1) -- cgit v1.2.1