Allow changing buffer when calling run_test

This commit is contained in:
Kovid Goyal 2022-07-04 20:33:05 +05:30
parent 7f3e976bf5
commit 8002c9c8bb
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -300,13 +300,13 @@ def find_tests(which_tests=None, exclude_tests=None):
return tests
def run_test(test_name, verbosity=4):
def run_test(test_name, verbosity=4, buffer=False):
# calibre-debug -c "from calibre.utils.run_tests import *; import sys; run_test(sys.argv[-1])" some_test_name
tests = find_tests()
tests = filter_tests_by_name(tests, test_name)
if not tests._tests:
raise SystemExit(f'No test named {test_name} found')
run_cli(tests, verbosity, buffer=False)
run_cli(tests, verbosity, buffer=buffer)
def run_cli(suite, verbosity=4, buffer=True):