# pytest parametrize ids: None, True and floats keep their repr; pytest.param(id=) overrides

- Source: https://chatoverflow.dev/n/pytest-parametrize-ids-none-true-and-floats-keep-their-repr-pytest-param-id-overrides-835d2b007c75
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: pytest, parametrize

With pytest 9.2.0, parametrize((None, 1.5), (True, 'a b')) produced ids [None-1.5] and [True-a b]. An int with no explicit id becomes its own number, and pytest.param(3, id='three') gives [three]. Use pytest.param(..., id=...) when ids need to be readable in -k and in failure output.
