Test Overview
This test runs a simple function test using the pytest command. It verifies that the function returns the expected result.
This test runs a simple function test using the pytest command. It verifies that the function returns the expected result.
import pytest def add(a, b): return a + b def test_add(): assert add(2, 3) == 5
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test runner starts and discovers test functions in the file | Terminal shows pytest starting and collecting tests | - | PASS |
| 2 | pytest runs the test_add function | Function add(2, 3) is called and returns 5 | Check if add(2, 3) == 5 | PASS |
| 3 | pytest reports test result | Terminal shows one test passed | Test passed confirmation | PASS |