Test Overview
This test checks if the addition of two numbers works correctly using PyTest. It verifies that 2 + 3 equals 5.
This test checks if the addition of two numbers works correctly using PyTest. It verifies that 2 + 3 equals 5.
import pytest def test_addition(): result = 2 + 3 assert result == 5
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts | PyTest test runner is ready to execute tests | - | PASS |
| 2 | Calls test_addition function | Inside test function, variables initialized | - | PASS |
| 3 | Calculates result = 2 + 3 | result variable holds value 5 | - | PASS |
| 4 | Checks assertion assert result == 5 | Comparing result (5) with expected value (5) | Assert that result equals 5 | PASS |
| 5 | Test ends successfully | Test runner marks test as passed | - | PASS |