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

Skip to content

Commit 161a81b

Browse files
committed
TST: fix tests
1 parent 9bb232b commit 161a81b

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

lib/matplotlib/tests/test_text.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,7 @@ def test_annotation_units(fig_test, fig_ref):
618618
def test_large_subscript_title():
619619
# Remove this line when this test image is regenerated.
620620
plt.rcParams['text.kerning_factor'] = 6
621+
plt.rcParams['axes.titley'] = None
621622

622623
fig, axs = plt.subplots(1, 2, figsize=(9, 2.5), constrained_layout=True)
623624
ax = axs[0]
@@ -626,9 +627,7 @@ def test_large_subscript_title():
626627
ax.set_xticklabels('')
627628

628629
ax = axs[1]
629-
tt = ax.set_title(r'$\sum_{i} x_i$')
630-
x, y = tt.get_position()
631-
tt.set_position((x, 1.01))
630+
tt = ax.set_title(r'$\sum_{i} x_i$', y=1.01)
632631
ax.set_title('Old Way', loc='left')
633632
ax.set_xticklabels('')
634633

lib/matplotlib/tests/test_tightlayout.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def example_plot(ax, fontsize=12):
1919
ax.set_title('Title', fontsize=fontsize)
2020

2121

22-
@image_comparison(['tight_layout1'])
22+
@image_comparison(['tight_layout1'], tol=1.9)
2323
def test_tight_layout1():
2424
"""Test tight_layout for a single subplot."""
2525
fig, ax = plt.subplots()
@@ -115,7 +115,7 @@ def test_tight_layout6():
115115
h_pad=0.45)
116116

117117

118-
@image_comparison(['tight_layout7'])
118+
@image_comparison(['tight_layout7'], tol=1.9)
119119
def test_tight_layout7():
120120
# tight layout with left and right titles
121121
fontsize = 24

0 commit comments

Comments
 (0)