Backport PR #24657 on branch v3.6.x (BUG: Fix bug with mutable input modification) by meeseeksmachine · Pull Request #24659 · matplotlib/matplotlib · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/matplotlib/image.py
2 changes: 2 additions & 0 deletions lib/matplotlib/tests/test_agg.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,11 @@ def test_pil_kwargs_webp():
buf_small = io.BytesIO()
pil_kwargs_low = {"quality": 1}
plt.savefig(buf_small, format="webp", pil_kwargs=pil_kwargs_low)
assert len(pil_kwargs_low) == 1
buf_large = io.BytesIO()
pil_kwargs_high = {"quality": 100}
plt.savefig(buf_large, format="webp", pil_kwargs=pil_kwargs_high)
assert len(pil_kwargs_high) == 1
assert buf_large.getbuffer().nbytes > buf_small.getbuffer().nbytes


Expand Down
1 change: 1 addition & 0 deletions lib/matplotlib/tests/test_image.py