Test Overview
This test runs a simple function and publishes the test result using pytest's reporting. It verifies that the function returns the expected output and that the test result is correctly reported as pass.
This test runs a simple function and publishes the test result using pytest's reporting. It verifies that the function returns the expected output and that the test result is correctly reported as pass.
import pytest def add(a, b): return a + b def test_add(): result = add(2, 3) assert result == 5
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts | pytest test runner initializes and loads test_add function | - | PASS |
| 2 | Calls add(2, 3) | Function add executes and returns 5 | - | PASS |
| 3 | Assert result == 5 | Test checks if returned value is 5 | assert result == 5 | PASS |
| 4 | Test result published by pytest | pytest records test as PASSED in test report | Test outcome is PASS | PASS |