# ValueError: The number of names (2) and values (3) must match

- **ID:** `python/pytest-parametrize-valueerror`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The @pytest.mark.parametrize decorator has a mismatch between the number of parameter names and the number of values in a tuple.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |
| 3.12 | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   Ensure each tuple in the values list has exactly the same number of elements as names: `@pytest.mark.parametrize('a,b', [(1,2), (3,4)])`
   ```
2. **** (90% success)
   ```
   Use a dictionary for named parameters if the count is variable: `@pytest.mark.parametrize('test_input,expected', [{'test_input': 1, 'expected': 2}])`
   ```

## Dead Ends

- **** — This can lead to confusing test results and unused parameters that obscure the test's purpose. (85% fail)
- **** — This changes the structure of the parameterization, often causing type errors or unexpected test cases. (70% fail)
