Add a test for indirect use of tuple in the assert that should not cause a warning

This commit is contained in:
Vasily Kuznetsov 2016-06-26 02:21:51 +02:00
parent 0db4ae15a9
commit 6d4cee2159
1 changed files with 10 additions and 0 deletions

View File

@ -648,3 +648,13 @@ def test_assert_tuple_warning(testdir):
""")
result = testdir.runpytest('-rw')
result.stdout.fnmatch_lines('WR1*:2 assertion is always true*')
def test_assert_indirect_tuple_no_warning(testdir):
testdir.makepyfile("""
def test_tuple():
tpl = ('foo', 'bar')
assert tpl
""")
result = testdir.runpytest('-rw')
output = '\n'.join(result.stdout.lines)
assert 'WR1' not in output