def test_accumulate_lengthhint_failure1():
    f_it = _hf.FailLengthHint(toT([1, 2, 3]))
    acc = accumulate(f_it)
    with pytest.raises(_hf.FailLengthHint.EXC_TYP, match=_hf.FailLengthHint.EXC_MSG):
        operator.length_hint(acc)

    with pytest.raises(_hf.FailLengthHint.EXC_TYP, match=_hf.FailLengthHint.EXC_MSG):
        list(acc)
Exemple #2
0
def test_grouper_lengthhint_failure1():
    f_it = _hf.FailLengthHint(toT([1, 2, 3]))
    it = grouper(f_it, 2)
    with pytest.raises(_hf.FailLengthHint.EXC_TYP) as exc:
        operator.length_hint(it)
    assert _hf.FailLengthHint.EXC_MSG in str(exc)

    with pytest.raises(_hf.FailLengthHint.EXC_TYP) as exc:
        list(it)
    assert _hf.FailLengthHint.EXC_MSG in str(exc)
Exemple #3
0
def test_sideeffects_failure_lengthhint1():
    f_it = _hf.FailLengthHint(toT([1, 2, 3]))
    it = sideeffects(f_it, return_None)
    with pytest.raises(_hf.FailLengthHint.EXC_TYP) as exc:
        operator.length_hint(it)
    assert _hf.FailLengthHint.EXC_MSG in str(exc)

    with pytest.raises(_hf.FailLengthHint.EXC_TYP) as exc:
        list(it)
    assert _hf.FailLengthHint.EXC_MSG in str(exc)
Exemple #4
0
def test_intersperse_lengthhint_failure1():
    f_it = _hf.FailLengthHint(toT([1, 2, 3]))
    it = intersperse(f_it, 2)
    with pytest.raises(_hf.FailLengthHint.EXC_TYP,
                       match=_hf.FailLengthHint.EXC_MSG):
        operator.length_hint(it)

    with pytest.raises(_hf.FailLengthHint.EXC_TYP,
                       match=_hf.FailLengthHint.EXC_MSG):
        list(it)
def test_roundrobin_failure_lengthhint1():
    f_it = _hf.FailLengthHint(toT([1, 2, 3]))
    it = roundrobin(f_it)
    with pytest.raises(_hf.FailLengthHint.EXC_TYP,
                       match=_hf.FailLengthHint.EXC_MSG):
        operator.length_hint(it)

    with pytest.raises(_hf.FailLengthHint.EXC_TYP,
                       match=_hf.FailLengthHint.EXC_MSG):
        list(it)
Exemple #6
0
def test_replicate_failure_lengthhint1():
    f_it = _hf.FailLengthHint(toT([1, 2, 3]))
    it = replicate(f_it, 3)
    with pytest.raises(_hf.FailLengthHint.EXC_TYP) as exc:
        operator.length_hint(it)
    assert _hf.FailLengthHint.EXC_MSG in str(exc)

    with pytest.raises(_hf.FailLengthHint.EXC_TYP) as exc:
        list(it)
    assert _hf.FailLengthHint.EXC_MSG in str(exc)
Exemple #7
0
def test_accumulate_lengthhint_failure1():
    f_it = _hf.FailLengthHint(toT([1, 2, 3]))
    acc = accumulate(f_it)
    with pytest.raises(_hf.FailLengthHint.EXC_TYP) as exc:
        operator.length_hint(acc)
    assert _hf.FailLengthHint.EXC_MSG in str(exc)

    with pytest.raises(_hf.FailLengthHint.EXC_TYP) as exc:
        list(acc)
    assert _hf.FailLengthHint.EXC_MSG in str(exc)
def test_successive_failure_lengthhint1():
    f_it = _hf.FailLengthHint(toT([1, 2, 3]))
    it = successive(f_it)
    with pytest.raises(_hf.FailLengthHint.EXC_TYP,
                       match=_hf.FailLengthHint.EXC_MSG):
        operator.length_hint(it)

    with pytest.raises(_hf.FailLengthHint.EXC_TYP,
                       match=_hf.FailLengthHint.EXC_MSG):
        list(it)
Exemple #9
0
def test_sideeffects_failure_lengthhint1():
    f_it = _hf.FailLengthHint(toT([1, 2, 3]))
    it = sideeffects(f_it, return_None)
    with pytest.raises(_hf.FailLengthHint.EXC_TYP,
                       match=_hf.FailLengthHint.EXC_MSG):
        operator.length_hint(it)

    with pytest.raises(_hf.FailLengthHint.EXC_TYP,
                       match=_hf.FailLengthHint.EXC_MSG):
        list(it)