# ValueError: Incorrect number of ids: 3 instead of 2

- **ID:** `python/pytest-mark-parametrize-ids-mismatch`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

In @pytest.mark.parametrize, the `ids` list length must match the number of parameter sets (not the number of arguments). Supplying too many or too few ids raises ValueError.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |
| 7.x | active | — | — |
| 8.x | active | — | — |

## Workarounds

1. **** (98% success)
   ```
   @pytest.mark.parametrize(
    'a,b',
    [(1, 2), (3, 4)],
    ids=['small', 'large'],  # 2 ids for 2 tuples
)
def test_add(a, b):
    ...
   ```
2. **** (90% success)
   ```
   def idfn(val):
    return f'v={val}'

@pytest.mark.parametrize('x', [1, 2, 3], ids=idfn)
def test_x(x):
    ...
   ```

## Dead Ends

- **** — pytest expects an iterable of id strings (or a callable); a single string is treated as an iterable of characters, producing confusing ids and possibly a length mismatch. (85% fail)
- **** — Works but loses readable test names; not a real fix if the user needs custom ids for reporting. (30% fail)
