Warn about asserts on tuples (fixes #1562)

This commit is contained in:
Vasily Kuznetsov
2016-06-25 18:45:47 +02:00
parent 68bed00d5b
commit c17027e576
2 changed files with 23 additions and 5 deletions

View File

@@ -640,3 +640,11 @@ def test_diff_newline_at_end(monkeypatch, testdir):
* + asdf
* ? +
""")
def test_assert_tuple_warning(testdir):
testdir.makepyfile("""
def test_tuple():
assert(False, 'you shall not pass')
""")
result = testdir.runpytest('-rw')
result.stdout.fnmatch_lines('WR1*:2 assertion is always true*')