pytest: Shorten traceback length by default
This produces a lot of code output which is not very helpful and is quite annoying to wade through. Use the short format by default. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
927e0eedfc
commit
b04f64aa48
@ -103,6 +103,13 @@ will be written to `${build_dir}/test-log.html`. This is best viewed in a web
|
|||||||
browser, but may be read directly as plain text, perhaps with the aid of the
|
browser, but may be read directly as plain text, perhaps with the aid of the
|
||||||
`html2text` utility.
|
`html2text` utility.
|
||||||
|
|
||||||
|
Controlling output
|
||||||
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
By default a short backtrace is reported. If you would like a longer one,
|
||||||
|
pass ``--tb=long`` when running the test. See the pytest documentation for
|
||||||
|
more options.
|
||||||
|
|
||||||
Running tests in parallel
|
Running tests in parallel
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -17,4 +17,9 @@ if __name__ == '__main__':
|
|||||||
# argv; py.test test_directory_name user-supplied-arguments
|
# argv; py.test test_directory_name user-supplied-arguments
|
||||||
args = [os.path.dirname(__file__) + '/tests']
|
args = [os.path.dirname(__file__) + '/tests']
|
||||||
args.extend(sys.argv)
|
args.extend(sys.argv)
|
||||||
|
|
||||||
|
# Use short format by default
|
||||||
|
if not [arg for arg in args if '--tb=' in arg]:
|
||||||
|
args.append('--tb=short')
|
||||||
|
|
||||||
sys.exit(pytest.main(args))
|
sys.exit(pytest.main(args))
|
||||||
|
Loading…
Reference in New Issue
Block a user