Skip to content

Commit 6d4cee2

Browse files
committed
Add a test for indirect use of tuple in the assert that should not cause a warning
1 parent 0db4ae1 commit 6d4cee2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

testing/test_assertion.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,3 +648,13 @@ def test_tuple():
648648
""")
649649
result = testdir.runpytest('-rw')
650650
result.stdout.fnmatch_lines('WR1*:2 assertion is always true*')
651+
652+
def test_assert_indirect_tuple_no_warning(testdir):
653+
testdir.makepyfile("""
654+
def test_tuple():
655+
tpl = ('foo', 'bar')
656+
assert tpl
657+
""")
658+
result = testdir.runpytest('-rw')
659+
output = '\n'.join(result.stdout.lines)
660+
assert 'WR1' not in output

0 commit comments

Comments
 (0)