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

Skip to content

Commit 2e0fee1

Browse files
authored
Merge pull request #31295 from QuLogic/test-cleanup
TST: Cleanup back-compat code in tests touched by text overhaul
2 parents 17b1f31 + 7c33379 commit 2e0fee1

7 files changed

Lines changed: 1 addition & 33 deletions

File tree

lib/matplotlib/tests/test_agg_filter.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
@image_comparison(baseline_images=['agg_filter_alpha'],
88
extensions=['gif', 'png', 'pdf'])
99
def test_agg_filter_alpha():
10-
# Remove this line when this test image is regenerated.
11-
plt.rcParams['pcolormesh.snap'] = False
12-
1310
ax = plt.axes()
1411
x, y = np.mgrid[0:7, 0:8]
1512
data = x**2 - y**2

lib/matplotlib/tests/test_axes.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,9 +1030,6 @@ def test_hexbin_pickable():
10301030
def test_hexbin_log():
10311031
# Issue #1636 (and also test log scaled colorbar)
10321032

1033-
# Remove this line when this test image is regenerated.
1034-
plt.rcParams['pcolormesh.snap'] = False
1035-
10361033
np.random.seed(19680801)
10371034
n = 100000
10381035
x = np.random.standard_normal(n)
@@ -1520,9 +1517,6 @@ def test_pcolormesh_log_scale(fig_test, fig_ref):
15201517
# TODO: tighten tolerance after baseline image is regenerated for text overhaul
15211518
@image_comparison(['pcolormesh_datetime_axis.png'], style='mpl20', tol=0.3)
15221519
def test_pcolormesh_datetime_axis():
1523-
# Remove this line when this test image is regenerated.
1524-
plt.rcParams['pcolormesh.snap'] = False
1525-
15261520
fig = plt.figure()
15271521
fig.subplots_adjust(hspace=0.4, top=0.98, bottom=.15)
15281522
base = datetime.datetime(2013, 1, 1)
@@ -5159,7 +5153,7 @@ def test_hist_stacked_bar():
51595153
colors = [(0.5759849696758961, 1.0, 0.0), (0.0, 1.0, 0.350624650815206),
51605154
(0.0, 1.0, 0.6549834156005998), (0.0, 0.6569064625276622, 1.0),
51615155
(0.28302699607823545, 0.0, 1.0), (0.6849123462299822, 0.0, 1.0)]
5162-
labels = ['green', 'orange', ' yellow', 'magenta', 'black']
5156+
labels = ['first', 'second', 'third', 'fourth', 'fifth']
51635157
fig, ax = plt.subplots()
51645158
ax.hist(d, bins=10, histtype='barstacked', align='mid', color=colors,
51655159
label=labels)

lib/matplotlib/tests/test_colorbar.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,6 @@ def test_colorbar_extension_inverted_axis(orientation, extend, expected):
161161
],
162162
remove_text=True, savefig_kwarg={'dpi': 40}, tol=0.05)
163163
def test_colorbar_positioning(use_gridspec):
164-
# Remove this line when this test image is regenerated.
165-
plt.rcParams['pcolormesh.snap'] = False
166-
167164
data = np.arange(1200).reshape(30, 40)
168165
levels = [0, 200, 400, 600, 800, 1000, 1200]
169166

lib/matplotlib/tests/test_colors.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -830,9 +830,6 @@ def _mask_tester(norm_instance, vals):
830830

831831
@image_comparison(['levels_and_colors.png'])
832832
def test_cmap_and_norm_from_levels_and_colors():
833-
# Remove this line when this test image is regenerated.
834-
plt.rcParams['pcolormesh.snap'] = False
835-
836833
data = np.linspace(-2, 4, 49).reshape(7, 7)
837834
levels = [-1, 2, 2.5, 3]
838835
colors = ['red', 'green', 'blue', 'yellow', 'black']
@@ -849,9 +846,6 @@ def test_cmap_and_norm_from_levels_and_colors():
849846

850847
@image_comparison(['boundarynorm_and_colorbar.png'], tol=1.0)
851848
def test_boundarynorm_and_colorbarbase():
852-
# Remove this line when this test image is regenerated.
853-
plt.rcParams['pcolormesh.snap'] = False
854-
855849
# Make a figure and axes with dimensions as desired.
856850
fig = plt.figure()
857851
ax1 = fig.add_axes((0.05, 0.80, 0.9, 0.15))

lib/matplotlib/tests/test_constrainedlayout.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,6 @@ def test_colorbar_location():
411411
Test that colorbar handling is as expected for various complicated
412412
cases...
413413
"""
414-
# Remove this line when this test image is regenerated.
415-
plt.rcParams['pcolormesh.snap'] = False
416-
417414
fig, axs = plt.subplots(4, 5, layout="constrained")
418415
for ax in axs.flat:
419416
pcm = example_pcolor(ax)

lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -562,15 +562,6 @@ def test_anchored_artists():
562562
box.drawing_area.add_artist(el)
563563
ax.add_artist(box)
564564

565-
# This block used to test the AnchoredEllipse class, but that was removed. The block
566-
# remains, though it duplicates the above ellipse, so that the test image doesn't
567-
# need to be regenerated.
568-
box = AnchoredAuxTransformBox(ax.transData, loc='lower left', frameon=True,
569-
pad=0.5, borderpad=0.4)
570-
el = Ellipse((0, 0), width=0.1, height=0.25, angle=-60)
571-
box.drawing_area.add_artist(el)
572-
ax.add_artist(box)
573-
574565
asb = AnchoredSizeBar(ax.transData, 0.2, r"0.2 units", loc='lower right',
575566
pad=0.3, borderpad=0.4, sep=4, fill_bar=True,
576567
frameon=False, label_top=True, prop={'size': 20},

lib/mpl_toolkits/mplot3d/tests/test_axes3d.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,6 @@ def test_surface3d():
650650
# TODO: tighten tolerance after baseline image is regenerated for text overhaul
651651
@image_comparison(['surface3d_label_offset_tick_position.png'], style='mpl20', tol=0.07)
652652
def test_surface3d_label_offset_tick_position():
653-
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
654653
ax = plt.figure().add_subplot(projection="3d")
655654

656655
x, y = np.mgrid[0:6 * np.pi:0.25, 0:4 * np.pi:0.25]
@@ -1733,7 +1732,6 @@ def test_errorbar3d():
17331732

17341733
@image_comparison(['stem3d.png'], style='mpl20', tol=0.009)
17351734
def test_stem3d():
1736-
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
17371735
fig, axs = plt.subplots(2, 3, figsize=(8, 6),
17381736
constrained_layout=True,
17391737
subplot_kw={'projection': '3d'})

0 commit comments

Comments
 (0)