FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Remove print() from test_agg_filter_alpha by iccir · Pull Request #32439 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
9 changes: 7 additions & 2 deletions lib/matplotlib/tests/test_agg_filter.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import matplotlib.pyplot as plt
from matplotlib.testing.decorators import image_comparison
from unittest.mock import Mock


@image_comparison(baseline_images=['agg_filter_alpha'],
Expand All @@ -14,17 +15,21 @@ def test_agg_filter_alpha():

def manual_alpha(im, dpi):
im[:, :, 3] *= 0.6
print('CALLED')
return im, 0, 0

wrapped_manual_alpha = Mock(wraps=manual_alpha)

# Note: Doing alpha like this is not the same as setting alpha on
# the mesh itself. Currently meshes are drawn as independent patches,
# and we see fine borders around the blocks of color. See the SO
# question for an example: https://stackoverflow.com/q/20678817/
mesh.set_agg_filter(manual_alpha)
mesh.set_agg_filter(wrapped_manual_alpha)

# Currently we must enable rasterization for this to have an effect in
# the PDF backend.
mesh.set_rasterized(True)

ax.plot([0, 4, 7], [1, 3, 8])
ax.figure.canvas.draw()

wrapped_manual_alpha.assert_called()
Loading

Back | FazBrowse Home | New Git URL