Test Overview
This test uses pytest fixtures where one fixture uses another fixture to prepare test data. It verifies that the composed fixtures work together to provide the correct final value.
This test uses pytest fixtures where one fixture uses another fixture to prepare test data. It verifies that the composed fixtures work together to provide the correct final value.
import pytest @pytest.fixture def base_number(): return 5 @pytest.fixture def multiplied_number(base_number): return base_number * 3 def test_composed_fixture(multiplied_number): assert multiplied_number == 15
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts | pytest test runner initialized | - | PASS |
| 2 | pytest collects test_composed_fixture and its fixtures | Fixtures base_number and multiplied_number recognized | - | PASS |
| 3 | pytest calls base_number fixture | base_number returns 5 | - | PASS |
| 4 | pytest calls multiplied_number fixture with base_number value | multiplied_number returns 15 (5 * 3) | - | PASS |
| 5 | pytest runs test_composed_fixture with multiplied_number value | test_composed_fixture receives 15 | assert multiplied_number == 15 | PASS |
| 6 | Test ends successfully | Test passed with no errors | - | PASS |