Example #1
0
def test_all_monotone_failure4():
    # too few arguments
    with pytest.raises(TypeError):
        all_monotone()
Example #2
0
def test_all_monotone_failure5():
    # Changing next method
    with pytest.raises(_hf.CacheNext.EXC_TYP, match=_hf.CacheNext.EXC_MSG):
        all_monotone(_hf.CacheNext(1))
Example #3
0
def test_all_monotone_failure2():
    # comparison fail
    with pytest.raises(TypeError):
        all_monotone([T(1), T('a')])
Example #4
0
def test_all_monotone_failure3():
    # Test that a failing iterator doesn't raise a SystemError
    with pytest.raises(_hf.FailNext.EXC_TYP, match=_hf.FailNext.EXC_MSG):
        all_monotone(_hf.FailNext())
Example #5
0
def test_all_monotone_normal9():
    # generator
    assert all_monotone(i for i in [T(1), T(1), T(1)])
Example #6
0
def test_all_monotone_failure1():
    with pytest.raises(_hf.FailIter.EXC_TYP, match=_hf.FailIter.EXC_MSG):
        all_monotone(_hf.FailIter())
Example #7
0
def test_all_monotone_normal5():
    assert all_monotone([T(1), T(1), T(1)], decreasing=True)
Example #8
0
def test_all_monotone_normal8():
    assert all_monotone([T(3), T(2), T(1)], decreasing=True, strict=True)
Example #9
0
def test_all_monotone_normal4():
    assert all_monotone([T(1), T(2), T(3)], strict=True)
Example #10
0
def test_all_monotone_normal3():
    assert all_monotone([T(1), T(2), T(3)])
Example #11
0
def test_all_monotone_normal2():
    assert not all_monotone([T(1), T(1), T(1)], strict=True)
Example #12
0
def test_all_monotone_normal1():
    assert all_monotone([T(1), T(1), T(1)])
Example #13
0
def test_all_monotone_empty1():
    assert all_monotone([])