pytest: "-l" does not dump variables where "--tb" is not "long"

Originally reported by: Ionel Cristian Mărieș (BitBucket: ionelmc, GitHub: ionelmc)


Example output

    > assert hist == ['before', 'the-return-valuex', 'after', 'finally', 'closed']
    E assert ['before', 't...ly', 'closed'] == ['before', 'th...ly', 'closed']
    E At index 1 diff: 'the-return-value' != 'the-return-valuex'

I use these options:

 -rxEfsl
--strict
--ignore docs/conf.py
--ignore setup.py
--doctest-modules
--doctest-glob \*.rst
--tb short

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 15 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Allowing --showlocals with --tb=short seems simple: #6384

thoughts on making --showlocals + --tb= anything but long / auto an error? I could write up a PR for this to features

It could be useful with other styles, e.g. short: #1715.

+1 for making showlocals work with short. There’s no reason to disable showlocals for --tb=short, it looks like a clear bug. The code comment here also indicates this wasn’t intended, showlocals should only be disable for --tb=native.

Found this issue because we ran into the same problem for SciPy at https://github.com/scipy/scipy/pull/11282