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