The AllPairs class generates a set of test combinations using the pairwise combinations method. This reduces the total number of combinations while ensuring most variable interactions are covered. It provides a Pythonic, iterator-style interface.
Pass a list of lists (where each inner list represents the possible values for a parameter) to the AllPairs constructor.
from allpairspy import AllPairs
parameters = [
["Brand X", "Brand Y"],
["98", "NT", "2000", "XP"],
["Internal", "Modem"],
["Salaried", "Hourly", "Part-Time", "Contr."],
[6, 10, 15, 30, 60],
]
for i, pairs in enumerate(AllPairs(parameters)):
print("{:2d}: {}".format(i, pairs))