Misleading output with verbose "-v" caused by repr
.
#5639
Labels
topic: reporting
related to terminal output and user-facing messages and errors
topic: rewrite
related to the assertion rewrite mechanism
type: bug
problem that needs to be addressed
Code example shows test file and output for which
pytest
in misleading way shows the cause of error when verbose (pytest -v
) is used. The reason is that equal items have differentrepr
but faulty ones text representation is the same.The output is misleading because the real cause of assertion failure is another item (item with
None
in example) not the item which++
indicates.This is especially confusing when (in this case) outermost
list
contains more than 2 items (just duplicate lines withEst(None)
like 10+ times) because the faulty/other items are merged and equal ones with differentrepr
are displayed like they are the cause of failure.Output with less verbosity (w/o
-v
) is more accurate. More verbose levels than-v
are equally confusing.pip list
from the virtual environment you are usingpytest and operating system versions
OS 5.1.14-arch1-1-ARCH
pytest 4.1.0; 5.0.1
minimal example if possible
Notice comments in code.
The most accurate output w/o
-v
.Confusing output when
-vvv
is used with less items.Even more confusing output when there is more items with matching repr.
The text was updated successfully, but these errors were encountered: