@pytest.mark.parametrize('colnos,constraints,numpredictions',
    [(colnos, constraints, numpred)
        for colnos in powerset(range(1,3))
        for constraints in [None] + list(powerset(range(1,3)))
        for numpred in range(3)])
def test_t1_simulate(colnos, constraints, numpredictions):
    if len(colnos) == 0:
        # No need to try this or confirm it fails gracefully --
        # nothing should be trying it anyway, and bayeslite_simulate
        # is not exposed to users of the bayeslite API.
        return
    with analyzed_bayesdb_generator(t1(), 1, 1) as (bdb, generator_id):
        if constraints is not None:
            rowid = 1           # XXX Avoid hard-coding this.
            # Can't use t1_rows[0][i] because not all t1-based tables
            # use the same column indexing -- some use a subset of the
            # columns.
            #
            # XXX Automatically test the correct exception.
            constraints = \
                [(i, bayesdb_generator_cell_value(bdb, generator_id, i, rowid))
                    for i in constraints]
        bqlfn.bayesdb_simulate(bdb, generator_id, constraints, colnos,
            numpredictions=numpredictions)
dataset/ETHPy150Open probcomp/bayeslite/tests/test_core.py/test_t1_simulate/original