parent
bb755ae009
commit
56c1391a16
|
@ -1,3 +1,8 @@
|
|||
Changes between 1.1.2 and 1.1.1
|
||||
=====================================
|
||||
|
||||
- fix assert reinterpreation that sees a call containing "keyword=..."
|
||||
|
||||
Changes between 1.1.1 and 1.1.0
|
||||
=====================================
|
||||
|
||||
|
|
|
@ -234,7 +234,7 @@ class DebugInterpreter(ast.NodeVisitor):
|
|||
arg_explanation, arg_result = self.visit(keyword.value)
|
||||
arg_name = "__exprinfo_%s" % (len(ns),)
|
||||
ns[arg_name] = arg_result
|
||||
keyword_source = "%s=%%s" % (keyword.id)
|
||||
keyword_source = "%s=%%s" % (keyword.arg)
|
||||
arguments.append(keyword_source % (arg_name,))
|
||||
arg_explanations.append(keyword_source % (arg_explanation,))
|
||||
if call.starargs:
|
||||
|
|
|
@ -93,6 +93,14 @@ def test_assert_non_string_message():
|
|||
e = exvalue()
|
||||
assert e.msg == "hello"
|
||||
|
||||
def test_assert_keyword_arg():
|
||||
def f(x=3):
|
||||
return False
|
||||
try:
|
||||
assert f(x=5)
|
||||
except AssertionError:
|
||||
e = exvalue()
|
||||
assert "x=5" in e.msg
|
||||
|
||||
# These tests should both fail, but should fail nicely...
|
||||
class WeirdRepr:
|
||||
|
|
Loading…
Reference in New Issue