better error messages as discussed here:
http://codespeak.net/pipermail/py-dev/2009q2/001113.html --HG-- branch : trunk
This commit is contained in:
parent
975e681552
commit
46be553c25
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue