Coverage for /pythoncovmergedfiles/medio/medio/src/imageio/tests/fuzzers/fuzz_read.py: 43%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1###### Coverage stub
2import atexit
3import coverage
4cov = coverage.coverage(data_file='.coverage', cover_pylib=True)
5cov.start()
6# Register an exist handler that will print coverage
7def exit_handler():
8 cov.stop()
9 cov.save()
10atexit.register(exit_handler)
11####### End of coverage stub
12#!/usr/bin/python3
13import os
14import sys
15import atheris # type: ignore
17import imageio
20def TestOneInput(data):
21 with open("/tmp/img1.file", "wb+") as img1_f:
22 img1_f.write(data)
23 try:
24 imageio.imread("/tmp/img1.file")
25 except ValueError:
26 None
27 except RuntimeError:
28 None
29 os.remove("/tmp/img1.file")
32def main():
33 atheris.instrument_all()
34 atheris.Setup(sys.argv, TestOneInput)
35 atheris.Fuzz()
38if __name__ == "__main__":
39 main()