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.
Additionally, if you wish to display a list of fixtures for each test, try the --fixtures-per-test flag.
Running pytest -vv should make your output more verbose. If you want your output to be less verbose, try pytest -q or pytest --quiet .
The traceback error also shows the type of error and information about that error. The above case is IndexError: list index out of range . You can fix it using the valid index number to retrieve an item from a list.
For pytest, you can use py.test --tb=native
to switch to the full/native Python tracebacks.
See pytest documentation on tracebacks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With