def make_test_dice(*outcomes):    
    """Return an n-sided dice function that cycles deterministically through outcomes - a rest parameter.

    >>> dice = make_test_dice(4, 1, 3)
    >>> dice(), dice(), dice(), dice()
    (4, 1, 3, 4)
    
    """
    assert len(outcomes) > 0, 'You must supply outcomes to make_test_dice'
    for o in outcomes:
        assert type(o) == int and o >= 1, 'Outcome is not a positive integer'
    index = len(outcomes) - 1
    def dice():
        nonlocal index
        index = (index + 1) % len(outcomes)
        return outcomes[index]
    return dice