Add a test for indirect use of tuple in the assert that should not cause a warning
This commit is contained in:
parent
0db4ae15a9
commit
6d4cee2159
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue