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.

Cerin
  • 60,957
  • 96
  • 316
  • 522
  • 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 '16 at 23:01

2 Answers2

7

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

See pytest documentation on tracebacks.

flying sheep
  • 8,475
  • 5
  • 56
  • 73
bluenote10
  • 23,414
  • 14
  • 122
  • 178
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