Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 84fdda2

Browse filesBrowse files
committed
TST: remove now no-op calls to plt.draw() in test suite
1 parent 188edb9 commit 84fdda2
Copy full SHA for 84fdda2

File tree

7 files changed

+6
-14
lines changed
Filter options

7 files changed

+6
-14
lines changed

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+5-7Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def test_twinx_cla():
286286
fig, ax = plt.subplots()
287287
ax2 = ax.twinx()
288288
ax3 = ax2.twiny()
289-
plt.draw()
289+
290290
assert not ax2.xaxis.get_visible()
291291
assert not ax2.patch.get_visible()
292292
ax2.cla()
@@ -430,7 +430,7 @@ def test_autoscale_log_shared():
430430
ax2.semilogx(x, x)
431431
ax1.autoscale(tight=True)
432432
ax2.autoscale(tight=True)
433-
plt.draw()
433+
434434
lims = (x[1], x[-1])
435435
assert_allclose(ax1.get_xlim(), lims)
436436
assert_allclose(ax1.get_ylim(), lims)
@@ -3688,7 +3688,7 @@ def test_eventplot_problem_kwargs(recwarn):
36883688
def test_empty_eventplot():
36893689
fig, ax = plt.subplots(1, 1)
36903690
ax.eventplot([[]], colors=[(0.0, 0.0, 0.0, 0.0)])
3691-
plt.draw()
3691+
36923692

36933693

36943694
@pytest.mark.parametrize('data', [[[]], [[], [0, 1]], [[0, 1], []]])
@@ -3701,7 +3701,7 @@ def test_eventplot_orientation(data, orientation):
37013701
with (pytest.warns(MatplotlibDeprecationWarning)
37023702
if orientation in [None, 'none'] else nullcontext()):
37033703
ax.eventplot(data, **opts)
3704-
plt.draw()
3704+
37053705

37063706

37073707
@image_comparison(['marker_styles.png'], remove_text=True)
@@ -4314,7 +4314,6 @@ def test_shared_with_aspect_2():
43144314
axs[0].set_aspect(2, share=True)
43154315
axs[0].plot([1, 2], [3, 4])
43164316
axs[1].plot([3, 4], [1, 2])
4317-
plt.draw() # Trigger apply_aspect().
43184317
assert axs[0].get_xlim() == axs[1].get_xlim()
43194318
assert axs[0].get_ylim() == axs[1].get_ylim()
43204319

@@ -4327,7 +4326,6 @@ def test_shared_with_aspect_3():
43274326
axs[1].set_aspect(0.5, adjustable=adjustable)
43284327
axs[0].plot([1, 2], [3, 4])
43294328
axs[1].plot([3, 4], [1, 2])
4330-
plt.draw() # Trigger apply_aspect().
43314329
assert axs[0].get_xlim() != axs[1].get_xlim()
43324330
assert axs[0].get_ylim() == axs[1].get_ylim()
43334331
fig_aspect = fig.bbox_inches.height / fig.bbox_inches.width
@@ -4612,7 +4610,7 @@ def test_subsampled_ticklabels():
46124610
ax.xaxis.set_ticks(np.arange(10) + 0.1)
46134611
ax.locator_params(nbins=5)
46144612
ax.xaxis.set_ticklabels([c for c in "bcdefghijk"])
4615-
plt.draw()
4613+
46164614
labels = [t.get_text() for t in ax.xaxis.get_ticklabels()]
46174615
assert labels == ['b', 'd', 'f', 'h', 'j']
46184616

‎lib/matplotlib/tests/test_collections.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_collections.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,6 @@ def test_picking():
448448

449449
def test_linestyle_single_dashes():
450450
plt.scatter([0, 1, 2], [0, 1, 2], linestyle=(0., [2., 2.]))
451-
plt.draw()
452451

453452

454453
@image_comparison(['size_in_xy.png'], remove_text=True)

‎lib/matplotlib/tests/test_colorbar.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_colorbar.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,6 @@ def test_mappable_no_alpha():
577577
sm = cm.ScalarMappable(norm=mcolors.Normalize(), cmap='viridis')
578578
fig.colorbar(sm)
579579
sm.set_cmap('plasma')
580-
plt.draw()
581580

582581

583582
def test_colorbar_label():

‎lib/matplotlib/tests/test_colors.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_colors.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,6 @@ def test_autoscale_masked():
725725
# Test for #2336. Previously fully masked data would trigger a ValueError.
726726
data = np.ma.masked_all((12, 20))
727727
plt.pcolor(data)
728-
plt.draw()
729728

730729

731730
@image_comparison(['light_source_shading_topo.png'])

‎lib/matplotlib/tests/test_pickle.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_pickle.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ def test_polar():
140140
fig = plt.gcf()
141141
pf = pickle.dumps(fig)
142142
pickle.loads(pf)
143-
plt.draw()
144143

145144

146145
class TransformBlob:

‎lib/matplotlib/tests/test_spines.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_spines.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ def test_label_without_ticks():
7979
ax.set_xlabel('x label')
8080
ax.xaxis.set_ticks([])
8181
ax.yaxis.set_ticks([])
82-
plt.draw()
8382

8483
spine = ax.spines['left']
8584
spinebbox = spine.get_transform().transform_path(

‎lib/matplotlib/tests/test_transforms.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_transforms.py
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,11 @@ def transform_non_affine(self, path):
4141
my_trans = AssertingNonAffineTransform()
4242
ax = plt.axes()
4343
plt.plot(np.arange(10), transform=my_trans + ax.transData)
44-
plt.draw()
44+
4545
# enable the transform to raise an exception if it's non-affine transform
4646
# method is triggered again.
4747
my_trans.raise_on_transform = True
4848
ax.transAxes.invalidate()
49-
plt.draw()
5049

5150

5251
def test_external_transform_api():

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.