Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d6eb767

Browse files
committed
Consolidate test_figimage[01] into a single test.
1 parent 793c6b0 commit d6eb767

5 files changed

Lines changed: 3 additions & 14 deletions

File tree

-58.2 KB
Binary file not shown.
-57.9 KB
Binary file not shown.

lib/matplotlib/tests/baseline_images/test_image/figimage-0.pdf renamed to lib/matplotlib/tests/baseline_images/test_image/figimage.pdf

File renamed without changes.

lib/matplotlib/tests/baseline_images/test_image/figimage-0.png renamed to lib/matplotlib/tests/baseline_images/test_image/figimage.png

File renamed without changes.

lib/matplotlib/tests/test_image.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ def test_interp_nearest_vs_none():
7878
ax2.set_title('interpolation nearest')
7979

8080

81-
def do_figimage(suppressComposite):
82-
"""Helper for the next two tests."""
81+
@pytest.mark.parametrize('suppressComposite', [False, True])
82+
@image_comparison(['figimage'], extensions=['png', 'pdf'])
83+
def test_figimage(suppressComposite):
8384
fig = plt.figure(figsize=(2, 2), dpi=100)
8485
fig.suppressComposite = suppressComposite
8586
x, y = np.ix_(np.arange(100) / 100.0, np.arange(100) / 100)
@@ -93,18 +94,6 @@ def do_figimage(suppressComposite):
9394
fig.figimage(img[::-1, ::-1], xo=100, yo=100, origin='lower')
9495

9596

96-
@image_comparison(['figimage-0'], extensions=['png', 'pdf'])
97-
def test_figimage0():
98-
suppressComposite = False
99-
do_figimage(suppressComposite)
100-
101-
102-
@image_comparison(['figimage-1'], extensions=['png', 'pdf'])
103-
def test_figimage1():
104-
suppressComposite = True
105-
do_figimage(suppressComposite)
106-
107-
10897
def test_image_python_io():
10998
fig, ax = plt.subplots()
11099
ax.plot([1, 2, 3])

0 commit comments

Comments
 (0)