Improved the naming of tests which use the 'get_permutations' function. Adds the parameter values to the end of the test class.

This commit is contained in:
Benjamin Davis
2025-11-15 18:49:28 -07:00
committed by Alex Mykyta
parent 75a2163f6d
commit 6597f889fa
7 changed files with 37 additions and 24 deletions

View File

@@ -1,7 +1,20 @@
from itertools import product
def get_permutations(spec):
param_list = []
for v in product(*spec.values()):
param_list.append(dict(zip(spec, v)))
return param_list
def get_permutation_class_name(cls, num: int, params: dict) -> str:
class_name = cls.__name__
for val in params.values():
val_str = str(val)
if "object at" in val_str:
val_str = type(val).__name__
class_name += f"_{val_str}"
return class_name