From cc1186242ceeabe270fe0b15f102c0b0b19c1da4 Mon Sep 17 00:00:00 2001 From: Floris Bruynooghe Date: Wed, 29 Jan 2014 00:39:04 +0000 Subject: [PATCH] Avoid wasted string concatenation and improve english --- _pytest/assertion/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_pytest/assertion/__init__.py b/_pytest/assertion/__init__.py index 8b4bae45c..fdc279387 100644 --- a/_pytest/assertion/__init__.py +++ b/_pytest/assertion/__init__.py @@ -80,10 +80,10 @@ def pytest_runtest_setup(item): if new_expl: # Don't include pageloads of data unless we are very # verbose (-vv) - if (len(py.builtin._totext('').join(new_expl[1:])) > 80*8 + if (sum(len(p) for p in new_expl[1:]) > 80*8 and item.config.option.verbose < 2): new_expl[1:] = [py.builtin._totext( - 'Detailed information truncated, use "-vv" to see')] + 'Detailed information truncated, use "-vv" to show')] res = py.builtin._totext('\n~').join(new_expl) if item.config.getvalue("assertmode") == "rewrite": # The result will be fed back a python % formatting