6

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.

1
  • 2
    It looks like error happening inside conftest, where you trying to import module, which is not importable. Try py.test -vvs --pdb -k testname and this should drop you into pdb prompt to debug. (I know this works for tests, not 100% sure it will work for conftest).
    – sashk
    Apr 15, 2016 at 23:01

2 Answers 2

8

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

See pytest documentation on tracebacks.

0

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

2
  • I am getting a > tox: error: unrecognized arguments: --fulltrace
    – saul
    Sep 23, 2020 at 5:33
  • indeed, a dash was added in a iteration
    – user78110
    Feb 7, 2021 at 9:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.