py.test
's --verbose
option is required to show full diffs on assertion failures, but this also displays the full name of each test during execution (which is noisy).
I'd like full diffs to show when an assertion fails, but I only want single .
's to appear when the tests are running. Is there a way to do this?
Unfortunately, there seems to be no configuration or command line flag for that, since that's hard-coded deep inside pytest: when you define
--verbose
, you get the whole package. However, I've managed to come up with this hackish hack. Put the following function into yourconftest.py
:This is essentially a monkey-patching, relying on pytest internals, not guaranteed to be compatible with the future versions and ugly as sin. You can also make this patch conditional based on some other custom configuration of command-line argument.