def test_merge_failure13(): # Test that a failing iterator doesn't raise a SystemError mge = merge(_hf.FailNext(offset=2, repeats=10)) assert next(mge) == T(1) with pytest.raises(_hf.FailNext.EXC_TYP) as exc: next(mge) assert _hf.FailNext.EXC_MSG in str(exc)
def test_count_failure3(): # Regression test when accessing the next item of the iterable resulted # in an Exception. For example when the iterable was a filter and the # filter function threw an exception. with pytest.raises(_hf.FailNext.EXC_TYP) as exc: count_items(_hf.FailNext()) assert _hf.FailNext.EXC_MSG in str(exc)
def test_roundrobin_failure5(): # Test that a failing iterator doesn't raise a SystemError rr = roundrobin(_hf.FailNext(offset=1, repeats=10), [T(1), T(2), T(3), T(4)]) assert next(rr) == T(1) assert next(rr) == T(1) with pytest.raises(_hf.FailNext.EXC_TYP, match=_hf.FailNext.EXC_MSG): next(rr)
def test_allisinstance_failure3(): # Test that a failing iterator doesn't raise a SystemError with pytest.raises(_hf.FailNext.EXC_TYP) as exc: all_isinstance(_hf.FailNext(), T) assert _hf.FailNext.EXC_MSG in str(exc)
def test_starfilter_failure8(): # Test that a failing iterator doesn't raise a SystemError with pytest.raises(_hf.FailNext.EXC_TYP, match=_hf.FailNext.EXC_MSG): next(starfilter(operator.ne, _hf.FailNext()))
def test_unique_justseen_failure4(): # Test that a failing iterator doesn't raise a SystemError with pytest.raises(_hf.FailNext.EXC_TYP, match=_hf.FailNext.EXC_MSG): next(unique_justseen(_hf.FailNext()))
def test_minmax_failure13(): # Test that a failing iterator doesn't raise a SystemError with pytest.raises(_hf.FailNext.EXC_TYP, match=_hf.FailNext.EXC_MSG): minmax(_hf.FailNext(offset=1))
def test_starfilter_failure8(): # Test that a failing iterator doesn't raise a SystemError with pytest.raises(_hf.FailNext.EXC_TYP) as exc: next(starfilter(operator.ne, _hf.FailNext())) assert _hf.FailNext.EXC_MSG in str(exc)
def test_argmin_failure9(): # Test that a failing iterator doesn't raise a SystemError # with default with pytest.raises(_hf.FailNext.EXC_TYP) as exc: argmin(_hf.FailNext(), default=1) assert _hf.FailNext.EXC_MSG in str(exc)
def test_intersperse_failure2(): # Test that a failing iterator doesn't raise a SystemError with pytest.raises(_hf.FailNext.EXC_TYP, match=_hf.FailNext.EXC_MSG): next(intersperse(_hf.FailNext(), T(0)))
def test_replicate_failure5(): # iterator throws an exception different from StopIteration with pytest.raises(_hf.FailNext.EXC_TYP, match=_hf.FailNext.EXC_MSG): list(replicate(_hf.FailNext(), 2))
def test_duplicates_failure3(): # Test that a failing iterator doesn't raise a SystemError with pytest.raises(_hf.FailNext.EXC_TYP) as exc: next(duplicates(_hf.FailNext())) assert _hf.FailNext.EXC_MSG in str(exc)
def test_successive_failure3(): # Test that a failing iterator doesn't raise a SystemError with pytest.raises(_hf.FailNext.EXC_TYP) as exc: next(successive(_hf.FailNext(), 1)) assert _hf.FailNext.EXC_MSG in str(exc)
def test_deepflatten_failure4(): # Test that a failing iterator doesn't raise a SystemError with pytest.raises(_hf.FailNext.EXC_TYP, match=_hf.FailNext.EXC_MSG): next(deepflatten([[_hf.FailNext()], 2]))
def test_intersperse_failure2(): # Test that a failing iterator doesn't raise a SystemError with pytest.raises(_hf.FailNext.EXC_TYP) as exc: next(intersperse(_hf.FailNext(), T(0))) assert _hf.FailNext.EXC_MSG in str(exc)
def test_merge_failure12(): # Test that a failing iterator doesn't raise a SystemError with pytest.raises(_hf.FailNext.EXC_TYP) as exc: next(merge([T(1), T(1)], _hf.FailNext())) assert _hf.FailNext.EXC_MSG in str(exc)
def test_roundrobin_failure4(): # Test that a failing iterator doesn't raise a SystemError with pytest.raises(_hf.FailNext.EXC_TYP, match=_hf.FailNext.EXC_MSG): list(roundrobin([T(1), T(2)], _hf.FailNext()))
def test_nth_failures6(): # Test that a failing iterator doesn't raise a SystemError with pytest.raises(_hf.FailNext.EXC_TYP) as exc: nth(1)(_hf.FailNext()) assert _hf.FailNext.EXC_MSG in str(exc)
def test_replicate_failure5(): # iterator throws an exception different from StopIteration with pytest.raises(_hf.FailNext.EXC_TYP) as exc: list(replicate(_hf.FailNext(), 2)) assert _hf.FailNext.EXC_MSG in str(exc)
def test_split_failure8(): # Test that a failing iterator doesn't raise a SystemError with pytest.raises(_hf.FailNext.EXC_TYP) as exc: next(split(_hf.FailNext(), iteration_utilities.return_False)) assert _hf.FailNext.EXC_MSG in str(exc)
def test_sideeffects_failure7(): # Test that a failing iterator doesn't raise a SystemError with pytest.raises(_hf.FailNext.EXC_TYP) as exc: list(sideeffects(_hf.FailNext(), lambda x: x)) assert _hf.FailNext.EXC_MSG in str(exc)
def test_partition_failure5(): # Test that a failing iterator doesn't raise a SystemError with pytest.raises(_hf.FailNext.EXC_TYP, match=_hf.FailNext.EXC_MSG): partition(_hf.FailNext(), bool)
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())
def test_groupedby_failure8(): # Test that a failing iterator doesn't raise a SystemError with pytest.raises(_hf.FailNext.EXC_TYP) as exc: groupedby(_hf.FailNext(), bool) assert _hf.FailNext.EXC_MSG in str(exc)
def test_grouper_failure5(): # Test that a failing iterator doesn't raise a SystemError with pytest.raises(_hf.FailNext.EXC_TYP) as exc: next(grouper(_hf.FailNext(offset=1), 2)) assert _hf.FailNext.EXC_MSG in str(exc)
def test_merge_failure12(): # Test that a failing iterator doesn't raise a SystemError with pytest.raises(_hf.FailNext.EXC_TYP, match=_hf.FailNext.EXC_MSG): next(merge([T(1), T(1)], _hf.FailNext()))
def test_duplicates_failure3(): # Test that a failing iterator doesn't raise a SystemError with pytest.raises(_hf.FailNext.EXC_TYP, match=_hf.FailNext.EXC_MSG): next(duplicates(_hf.FailNext()))
def test_split_failure9(): # Test that a failing iterator doesn't raise a SystemError with pytest.raises(_hf.FailNext.EXC_TYP, match=_hf.FailNext.EXC_MSG): next(split(_hf.FailNext(offset=1), iteration_utilities.return_False))
def test_groupedby_failure8(): # Test that a failing iterator doesn't raise a SystemError with pytest.raises(_hf.FailNext.EXC_TYP, match=_hf.FailNext.EXC_MSG): groupedby(_hf.FailNext(), bool)
def test_argmin_failure9(): # Test that a failing iterator doesn't raise a SystemError # with default with pytest.raises(_hf.FailNext.EXC_TYP, match=_hf.FailNext.EXC_MSG): argmin(_hf.FailNext(), default=1)