Dont buffer test output when running a specific test

This commit is contained in:
Kovid Goyal 2022-02-19 12:11:15 +05:30
parent 6fb3061c56
commit 2c4891b26d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 4 deletions

View File

@ -49,7 +49,7 @@ class Test(Command):
tests = filter_tests_by_name(tests, *opts.test_name)
if opts.exclude_test_name:
tests = remove_tests_by_name(tests, *opts.exclude_test_name)
run_cli(tests, verbosity=opts.test_verbosity)
run_cli(tests, verbosity=opts.test_verbosity, buffer=not opts.test_name)
class TestRS(Command):

View File

@ -126,8 +126,9 @@ def filter_tests_by_module(suite, *names):
def run_tests(find_tests, verbosity=4):
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('name', nargs='?', default=None,
help='The name of the test to run, for example: writing.WritingTest.many_many_basic or .many_many_basic for a shortcut')
parser.add_argument(
'name', nargs='?', default=None,
help='The name of the test to run, for example: writing.WritingTest.many_many_basic or .many_many_basic for a shortcut')
args = parser.parse_args()
tests = find_tests()
if args.name:
@ -137,7 +138,7 @@ def run_tests(find_tests, verbosity=4):
tests = filter_tests_by_module(tests, args.name)
if not tests._tests:
raise SystemExit('No test named %s found' % args.name)
run_cli(tests, verbosity)
run_cli(tests, verbosity, buffer=not args.name)
class TestImports(unittest.TestCase):