def TestOneInput(data): try: fuzzers.fuzz_font(data) except Exception: # We're catching all exceptions because Pillow's exceptions are # directly inheriting from Exception. pass
def test_fuzz_fonts(path): if not path: return with open(path, "rb") as f: try: fuzzers.fuzz_font(f.read()) except (Image.DecompressionBombError, Image.DecompressionBombWarning): pass assert True
def test_fuzz_fonts(path): if not path or b"LICENSE.txt" in path or b".pil" in path: return with open(path, "rb") as f: fuzzers.fuzz_font(f.read()) assert True