def test_values():
result = [1, 2, 3]
assert result == [1, 2, 3, 4]What happens when this test runs?
- aIt fails with an AssertionError, since the two lists differ in length✓
- bIt raises a TypeError before comparing the lists
- cIt passes, because both objects are lists
- dpytest skips the test automatically because the lists differ, without ever raising an error
Explanation:
== between lists compares element by element and length; [1,2,3] != [1,2,3,4], so the bare assert raises AssertionError, which pytest reports as a test failure (not an error, not a skip).