Test Overview
This test checks if two values are equal and if two other values are not equal using simple assertions in pytest.
This test checks if two values are equal and if two other values are not equal using simple assertions in pytest.
import pytest def test_compare_values(): a = 5 b = 5 c = 10 d = 20 assert a == b, "Values a and b should be equal" assert c != d, "Values c and d should not be equal"
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts | pytest test runner initialized | - | PASS |
| 2 | Assign values a=5, b=5, c=10, d=20 | Variables set in test function | - | PASS |
| 3 | Assert that a equals b | a=5, b=5 | Check if a == b | PASS |
| 4 | Assert that c does not equal d | c=10, d=20 | Check if c != d | PASS |
| 5 | Test ends successfully | All assertions passed | - | PASS |