Skip to content

Commit 98e6c95

Browse files
committed
FIX: Clean up in the new quiverkey test; make new figs in scale tests
Merging the new quiverkey test seemed to cause nondeterministic failures of test_log_scales and test_logit_scales. I couldn't reproduce but here's a guess: the new test creates a figure and doesn't close it, and the scale tests just call plt.subplot which would usually create a new figure but if the test gets executed right after the new test, they just add a subplot on the existing figure.
1 parent c511628 commit 98e6c95

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/matplotlib/tests/test_quiver.py

+1
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ def test_bad_masked_sizes():
162162
ax.barbs(x, y, u, v)
163163

164164

165+
@cleanup
165166
def test_quiverkey_angles():
166167
# Check that only a single arrow is plotted for a quiverkey when an array
167168
# of angles is given to the original quiver plot

lib/matplotlib/tests/test_scale.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
@image_comparison(baseline_images=['log_scales'], remove_text=True)
1010
def test_log_scales():
11-
ax = plt.subplot(122, yscale='log', xscale='symlog')
11+
ax = plt.figure().add_subplot(122, yscale='log', xscale='symlog')
1212

1313
ax.axvline(24.1)
1414
ax.axhline(24.1)
@@ -17,7 +17,7 @@ def test_log_scales():
1717
@image_comparison(baseline_images=['logit_scales'], remove_text=True,
1818
extensions=['png'])
1919
def test_logit_scales():
20-
ax = plt.subplot(111, xscale='logit')
20+
ax = plt.figure().add_subplot(111, xscale='logit')
2121

2222
# Typical extinction curve for logit
2323
x = np.array([0.001, 0.003, 0.01, 0.03, 0.1, 0.2, 0.3, 0.4, 0.5,

0 commit comments

Comments
 (0)