allpairspy: Pairwise Test Combinations Generator

2.5.1 · active · verified Thu Apr 16

allpairspy is an open-source Python library for generating pairwise (all-pairs) test combinations. It helps reduce the number of test cases while ensuring comprehensive coverage by covering all possible pairs of input parameter values. The library is actively maintained with steady, though infrequent, releases.

Common errors

Warnings

Install

Imports

Quickstart

This example demonstrates how to generate pairwise test combinations from a list of input parameters. Each generated 'pairs' item is a combination that covers at least one occurrence of every possible pair of values from the input parameters.

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],
]

print("PAIRWISE:")
for i, pairs in enumerate(AllPairs(parameters)):
    print(f"{i:2d}: {pairs}")

view raw JSON →