Exemple #1
0
def test_all_monotone_failure4():
    # too few arguments
    with pytest.raises(TypeError):
        all_monotone()
Exemple #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))
Exemple #3
0
def test_all_monotone_failure2():
    # comparison fail
    with pytest.raises(TypeError):
        all_monotone([T(1), T('a')])
Exemple #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())
Exemple #5
0
def test_all_monotone_normal9():
    # generator
    assert all_monotone(i for i in [T(1), T(1), T(1)])
Exemple #6
0
def test_all_monotone_failure1():
    with pytest.raises(_hf.FailIter.EXC_TYP, match=_hf.FailIter.EXC_MSG):
        all_monotone(_hf.FailIter())
Exemple #7
0
def test_all_monotone_normal5():
    assert all_monotone([T(1), T(1), T(1)], decreasing=True)
Exemple #8
0
def test_all_monotone_normal8():
    assert all_monotone([T(3), T(2), T(1)], decreasing=True, strict=True)
Exemple #9
0
def test_all_monotone_normal4():
    assert all_monotone([T(1), T(2), T(3)], strict=True)
Exemple #10
0
def test_all_monotone_normal3():
    assert all_monotone([T(1), T(2), T(3)])
Exemple #11
0
def test_all_monotone_normal2():
    assert not all_monotone([T(1), T(1), T(1)], strict=True)
Exemple #12
0
def test_all_monotone_normal1():
    assert all_monotone([T(1), T(1), T(1)])
Exemple #13
0
def test_all_monotone_empty1():
    assert all_monotone([])