escape the % operator in string formatting
This commit is contained in:
parent
64c7c1be15
commit
b4588f1798
|
@ -1,6 +1,7 @@
|
|||
Changese between 2.2.3 and ...
|
||||
-----------------------------------
|
||||
|
||||
- fix error message for rewritten assertions involving the % operator
|
||||
- fix issue 126: correctly match all invalid xml characters for junitxml
|
||||
binary escape
|
||||
- fix issue with unittest: now @unittest.expectedFailure markers should
|
||||
|
|
|
@ -297,7 +297,7 @@ binop_map = {
|
|||
ast.Mult : "*",
|
||||
ast.Div : "/",
|
||||
ast.FloorDiv : "//",
|
||||
ast.Mod : "%",
|
||||
ast.Mod : "%%", # escaped for string formatting
|
||||
ast.Eq : "==",
|
||||
ast.NotEq : "!=",
|
||||
ast.Lt : "<",
|
||||
|
|
|
@ -195,6 +195,10 @@ class TestAssertionRewrite:
|
|||
y = -1
|
||||
assert x + y
|
||||
assert getmsg(f) == "assert (1 + -1)"
|
||||
def f():
|
||||
x = range(10)
|
||||
assert not 5 % 4
|
||||
assert getmsg(f) == "assert not (5 % 4)"
|
||||
|
||||
def test_call(self):
|
||||
def g(a=42, *args, **kwargs):
|
||||
|
|
Loading…
Reference in New Issue