예제 #1
0
def test_maxes_simple_no_key(values, ref, iter_type):
    """
    Test that :func:`utils.maxes` works in the simplest case.
    """
    assert utils.maxes(iter_type(values)) == ref
예제 #2
0
def test_maxes_key(values, ref, iter_type):
    """
    Test that :func:`utils.maxes` works when provided with a key.
    """
    assert utils.maxes(iter_type(values), key=lambda x: -x) == ref