Skip to content

Commit

Permalink
Add a test for indirect use of tuple in the assert that should not ca…
Browse files Browse the repository at this point in the history
…use a warning
  • Loading branch information
kvas-it committed Jun 26, 2016
1 parent 0db4ae1 commit 6d4cee2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions testing/test_assertion.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,3 +648,13 @@ def test_tuple():
""")
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

0 comments on commit 6d4cee2

Please sign in to comment.