def test_any (self): # no args assert not _any(istrue)() # single arg assert _any(istrue)(True) assert _any(isstring)("bad robot!") assert not _any(isfalse)(True) # multiple args assert _any(istrue)(False, True) assert _any(isstring)(42, "bad robot!") assert not _any(isfalse)(0, True)
def test_short_circuit (self): assert _any(passfail)(True, 'fail') assert not _all(passfail)(False, 'fail') assert not _none(passfail)(True, 'fail')