test for issue615: compound assert with percent

--HG--
branch : assert_percent_test
This commit is contained in:
TomV 2014-10-13 09:26:18 +01:00
parent b2341899c5
commit f8623a6668
1 changed files with 10 additions and 0 deletions

View File

@ -270,6 +270,16 @@ class TestAssertionRewrite:
assert not 5 % 4
assert getmsg(f) == "assert not (5 % 4)"
@pytest.mark.xfail(reason='unfixed')
def test_and_or_percent(self):
# issue 615 - ValueError on compound assert with percent
def f():
assert 3 % 2 or False
assert getmsg(f) == "assert (3 % 2) or False"
def f():
assert True and 7 % 3
assert getmsg(f) == "assert True and (7 % 3)"
def test_call(self):
def g(a=42, *args, **kwargs):
return False