PyTest - Writing Assertions
What is wrong with this pytest assertion?
def test_total():
total = 4 + 4
assert total == 8 == Truedef test_total():
total = 4 + 4
assert total == 8 == Truetotal == 8 == True is a chained comparison.total == 8 and 8 == True. Since 8 == True is false, the whole assertion fails unexpectedly.assert total == 8 without chaining.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions