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

Skip to content

Commit 9f12372

Browse files
author
astromancer
committed
cleanup test
1 parent 32a5daf commit 9f12372

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

lib/matplotlib/tests/test_patches.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
from numpy.testing import assert_almost_equal, assert_array_equal
66
import pytest
77

8-
from matplotlib.patches import Patch, Polygon, Rectangle, FancyArrowPatch
8+
from matplotlib.patches import (Annulus, Patch, Polygon, Rectangle,
9+
FancyArrowPatch)
910
from matplotlib.testing.decorators import image_comparison, check_figures_equal
1011
from matplotlib.transforms import Bbox
1112
import matplotlib.pyplot as plt
@@ -582,6 +583,18 @@ def test_rotated_arcs():
582583
ax.set_aspect("equal")
583584

584585

586+
@image_comparison(baseline_images=['annulus'], extensions=['png'])
587+
def test_annulus():
588+
589+
fig, ax = plt.subplots()
590+
cir = Annulus((0.5, 0.5), 0.2, 0.05, fc='g') # circular annulus
591+
ell = Annulus((0.5, 0.5), (0.5, 0.3), 0.1, 45, # elliptical
592+
fc='m', ec='b', alpha=0.5, hatch='xxx')
593+
ax.add_patch(cir)
594+
ax.add_patch(ell)
595+
ax.set_aspect('equal')
596+
597+
585598
def test_degenerate_polygon():
586599
point = [0, 0]
587600
correct_extents = Bbox([point, point]).extents
@@ -628,14 +641,4 @@ def test_default_joinstyle():
628641
assert patch.get_joinstyle() == 'miter'
629642

630643

631-
@image_comparison(baseline_images=['annulus'], extensions=['png'])
632-
def test_annulus():
633-
from matplotlib.patches import Annulus
634644

635-
fig, ax = plt.subplots()
636-
cir = Annulus((0.5, 0.5), 0.2, 0.05, fc='g') # circular annulus
637-
ell = Annulus((0.5, 0.5), (0.5, 0.3), 0.1, 45, # elliptical
638-
fc='m', ec='b', alpha=0.5, hatch='xxx')
639-
ax.add_patch(cir)
640-
ax.add_patch(ell)
641-
ax.set_aspect('equal')

0 commit comments

Comments
 (0)