From 46be553c25683fd23db4e8beaa79f3111cabacaf Mon Sep 17 00:00:00 2001 From: holger krekel Date: Tue, 28 Apr 2009 18:11:38 +0200 Subject: [PATCH] better error messages as discussed here: http://codespeak.net/pipermail/py-dev/2009q2/001113.html --HG-- branch : trunk --- py/magic/exprinfo.py | 6 +++--- py/magic/testing/test_exprinfo.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/py/magic/exprinfo.py b/py/magic/exprinfo.py index 77785a56e..2161c52a7 100644 --- a/py/magic/exprinfo.py +++ b/py/magic/exprinfo.py @@ -428,9 +428,9 @@ def interpret(source, frame, should_fail=False): import traceback traceback.print_exc() if should_fail: - return ("(assert failed but re-evaluating the assert expression " - "for printing intermediate values lead to a True value. " - "advise: avoid side-effects in assert expressions or use --nomagic)") + return ("(assertion failed, but when it was re-run for " + "printing intermediate values, it did not fail. Suggestions: " + "compute assert expression before the assert or use --nomagic)") else: return None diff --git a/py/magic/testing/test_exprinfo.py b/py/magic/testing/test_exprinfo.py index 517df1561..636997745 100644 --- a/py/magic/testing/test_exprinfo.py +++ b/py/magic/testing/test_exprinfo.py @@ -129,5 +129,5 @@ def test_inconsistent_assert_result(testdir): """) result = testdir.runpytest(p) s = result.stdout.str() - assert s.find("re-evaluating") + assert s.find("re-run") != -1