Test Overview
This test checks if the sum of two numbers is correct using a simple assert statement in pytest.
This test checks if the sum of two numbers is correct using a simple assert statement in pytest.
def test_sum(): result = 2 + 3 assert result == 5, f"Expected 5 but got {result}"
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test function 'test_sum' starts execution | Python interpreter ready to run the test | - | PASS |
| 2 | Calculate sum of 2 and 3, store in variable 'result' | Variable 'result' holds value 5 | - | PASS |
| 3 | Assert that 'result' equals 5 | Check if 5 == 5 | Assert statement verifies result == 5 | PASS |
| 4 | Test completes successfully | No errors raised, test passes | - | PASS |