mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Allow changing buffer when calling run_test
This commit is contained in:
parent
7f3e976bf5
commit
8002c9c8bb
@ -300,13 +300,13 @@ def find_tests(which_tests=None, exclude_tests=None):
|
|||||||
return tests
|
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
|
# calibre-debug -c "from calibre.utils.run_tests import *; import sys; run_test(sys.argv[-1])" some_test_name
|
||||||
tests = find_tests()
|
tests = find_tests()
|
||||||
tests = filter_tests_by_name(tests, test_name)
|
tests = filter_tests_by_name(tests, test_name)
|
||||||
if not tests._tests:
|
if not tests._tests:
|
||||||
raise SystemExit(f'No test named {test_name} found')
|
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):
|
def run_cli(suite, verbosity=4, buffer=True):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user