Skip to content

Commit 8d5afd6

Browse files
author
muxator
committed
tests: improve the signal/noise ratio of the test logs by 63%
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.
1 parent 1d17a57 commit 8d5afd6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tests/test_plot/base.py

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def test_run(self) -> None:
4444
def run(self) -> None:
4545
"""Run the plotting and the image comparison."""
4646
logging.getLogger("matplotlib.font_manager").disabled = True
47+
logging.getLogger("PIL.PngImagePlugin").setLevel(logging.INFO)
4748
plt.close()
4849
self.plotting_function.__func__(*self.args) # type: ignore[attr-defined]
4950
with TemporaryDirectory() as tmpdir:

0 commit comments

Comments
 (0)