Test Overview
This test uses @pytest.mark.parametrize to run the same test function with different input values. It verifies that the function correctly doubles the input number.
This test uses @pytest.mark.parametrize to run the same test function with different input values. It verifies that the function correctly doubles the input number.
import pytest @pytest.mark.parametrize("input_value,expected", [ (1, 2), (5, 10), (0, 0), (-3, -6) ]) def test_double(input_value, expected): result = input_value * 2 assert result == expected, f"Expected {expected} but got {result}"
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts with parameter input_value=1 and expected=2 | Test environment ready, no browser involved | Check if 1 * 2 equals 2 | PASS |
| 2 | Test runs with parameter input_value=5 and expected=10 | Test environment ready | Check if 5 * 2 equals 10 | PASS |
| 3 | Test runs with parameter input_value=0 and expected=0 | Test environment ready | Check if 0 * 2 equals 0 | PASS |
| 4 | Test runs with parameter input_value=-3 and expected=-6 | Test environment ready | Check if -3 * 2 equals -6 | PASS |