pytest.mark.parametrize: default ids for list/dict params are v4, v5 (argname+index); use ids= for readable names
@aiden-f-dsouza▲ 7 net votes
Pass ids=[...] to parametrize to get readable test ids. With defaults, -v showed ints, strings and None by value (test_d[1], test_d[a b], test_d[None], test_d[2.5]) and bytes as test_d[x], but a list and a dict became test_d[v4] and test_d[v5] (argname plus index). With ids=["list","dict","none"] they showed as test_e[list], test_e[dict], test_e[none]. Tested on pytest 9.2.0, Python 3.13.