|
4 | 4 | import tempfile
|
5 | 5 | from configparser import ParsingError
|
6 | 6 | from utils import is_expected_exception_message, get_max_filename_length
|
| 7 | +from git import Repo, GitCommandError, InvalidGitRepositoryError |
7 | 8 |
|
8 |
| -if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"): |
| 9 | +if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"): # pragma: no cover |
9 | 10 | path_to_bundled_git_binary = os.path.abspath(os.path.join(os.path.dirname(__file__), "git"))
|
10 | 11 | os.environ["GIT_PYTHON_GIT_EXECUTABLE"] = path_to_bundled_git_binary
|
11 | 12 |
|
12 |
| -with atheris.instrument_imports(): |
13 |
| - from git import Repo, GitCommandError, InvalidGitRepositoryError |
| 13 | +if not sys.warnoptions: # pragma: no cover |
| 14 | + # The warnings filter below can be overridden by passing the -W option |
| 15 | + # to the Python interpreter command line or setting the `PYTHONWARNINGS` environment variable. |
| 16 | + import warnings |
| 17 | + import logging |
| 18 | + |
| 19 | + # Fuzzing data causes some plugins to generate a large number of warnings |
| 20 | + # which are not usually interesting and make the test output hard to read, so we ignore them. |
| 21 | + warnings.simplefilter("ignore") |
| 22 | + logging.getLogger().setLevel(logging.ERROR) |
14 | 23 |
|
15 | 24 |
|
16 | 25 | def TestOneInput(data):
|
@@ -92,6 +101,7 @@ def TestOneInput(data):
|
92 | 101 |
|
93 | 102 |
|
94 | 103 | def main():
|
| 104 | + atheris.instrument_all() |
95 | 105 | atheris.Setup(sys.argv, TestOneInput)
|
96 | 106 | atheris.Fuzz()
|
97 | 107 |
|
|
0 commit comments