def test_boolean(input, output): if inspect.isclass(output): with pytest.raises(output): misc.boolean(input) else: assert misc.boolean(input) == output
def validate(config, key, value): try: return boolean(value) except ValueError as e: raise InvalidConfigOption(value, default) from e