Test Overview
This test checks that the pytest framework can discover and run a simple test function placed in the recommended project folder structure.
It verifies that the test file is found and the test passes successfully.
This test checks that the pytest framework can discover and run a simple test function placed in the recommended project folder structure.
It verifies that the test file is found and the test passes successfully.
import pytest def test_addition(): assert 2 + 3 == 5 # Project structure: # /project_root # /tests # test_math.py (this file) # Run with: pytest tests/
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test runner starts and looks for tests in the 'tests' folder | Project folder contains 'tests/test_math.py' with 'test_addition' function | - | PASS |
| 2 | pytest discovers 'test_addition' function inside 'test_math.py' | pytest test collection shows 1 test found | - | PASS |
| 3 | pytest runs 'test_addition' function | Function executes: assert 2 + 3 == 5 | Check that 2 + 3 equals 5 | PASS |
| 4 | pytest reports test result | Test passed with no errors | Test result is PASS | PASS |