1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #27430 -- Added -b/--buffer option to DiscoverRunner.

This commit is contained in:
Baptiste Mispelon
2019-11-30 22:10:16 +01:00
committed by Mariusz Felisiak
parent f464526388
commit 9e565386d3
6 changed files with 72 additions and 4 deletions

View File

@@ -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)