Skip to content

Commit

Permalink
tests: improve the signal/noise ratio of the test logs by 63%
Browse files Browse the repository at this point in the history
Before this change, the log of the tests were littered with messages from
Pillow:
    2024-09-10 18:04:55 [   DEBUG] STREAM b'IHDR' 16 13 (PngImagePlugin.py:197)
    2024-09-10 18:04:55 [   DEBUG] STREAM b'sBIT' 41 4 (PngImagePlugin.py:197)
    2024-09-10 18:04:55 [   DEBUG] b'sBIT' 41 4 (unknown) (PngImagePlugin.py:753)
    2024-09-10 18:04:55 [   DEBUG] STREAM b'pHYs' 57 9 (PngImagePlugin.py:197)

After this change, on my machine, the size of the log produced by running
"make test" goes from 1405 to 513 lines, a 63% reduction, that hopefully
increases the signal noise ratio of the test logs.
  • Loading branch information
muxator committed Sep 10, 2024
1 parent 32636e1 commit cf86f1a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/test_plot/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def test_run(self) -> None:
def run(self) -> None:
"""Run the plotting and the image comparison."""
logging.getLogger("matplotlib.font_manager").disabled = True
logging.getLogger("PIL.PngImagePlugin").setLevel(logging.INFO)
plt.close()
self.plotting_function.__func__(*self.args) # type: ignore[attr-defined]
with TemporaryDirectory() as tmpdir:
Expand Down

0 comments on commit cf86f1a

Please sign in to comment.