简体   繁体   中英

How to show full Python Traceback with Tox/Py.test

I'm using tox and py.test to run my Python unittests, and even though I'm using py.test's --tb=long option, errors are showing like:

E   ConftestImportFailure: (local('/myproject/tests/functional_tests/conftest.py'), (<type 'exceptions.ImportError'>, ImportError('No module named blah',), <traceback object at 0x7fb5bb740518>))

Tox is running the command:

py.test -rxs -rf -rs --ff --tb=long -x -k testname

How do I make is show the full traceback? I can't find anything mentioning this in the docs besides the --tb option.

For pytest, you can use py.test --tb=native to switch to the full/native Python tracebacks.

See pytest documentation on tracebacks.

by putting a {posargs} or [] into the command invocation, you can run tox -- --full-trace

a ConftestImportFailure tends to point to another mistake as well, their reporting is worse tho

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM