Bug Fix 11456: Duplicated parameters in @pytest.mark.parametrize

This commit is contained in:
TanyaAgarwal28 2023-10-08 16:35:31 +05:30
parent 54623f0f33
commit 92add35dca
1 changed files with 8 additions and 1 deletions

View File

@ -1002,7 +1002,14 @@ class IdMaker:
# Suffix non-unique IDs to make them unique.
for index, id in enumerate(resolved_ids):
if id_counts[id] > 1:
resolved_ids[index] = f"{id}{id_suffixes[id]}"
suffix = ""
if id[-1].isdigit():
suffix = "_"
new_id = f"{id}{suffix}{id_suffixes[id]}"
while new_id in set(resolved_ids):
id_suffixes[id] += 1
new_id = f"{id}{suffix}{id_suffixes[id]}"
resolved_ids[index] = new_id
id_suffixes[id] += 1
return resolved_ids