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 51634e7

Browse filesBrowse files
committed
TST: add title round-trip test
1 parent 8f1339f commit 51634e7
Copy full SHA for 51634e7

File tree

Expand file treeCollapse file tree

1 file changed

+14
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+14
-1
lines changed

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+14-1Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4112,7 +4112,6 @@ def test_violin_point_mass():
41124112
plt.violinplot(np.array([0, 0]))
41134113

41144114

4115-
41164115
@cleanup
41174116
def test_axisbg_warning():
41184117
fig = plt.figure()
@@ -4133,6 +4132,20 @@ def test_dash_offset():
41334132
plt.show()
41344133

41354134

4135+
@cleanup
4136+
def test_title_location_roundtrip():
4137+
fig, ax = plt.subplots()
4138+
ax.set_title('aardvark')
4139+
ax.set_title('left', loc='left')
4140+
ax.set_title('right', loc='right')
4141+
4142+
assert_equal('left', ax.get_title(loc='left'))
4143+
assert_equal('right', ax.get_title(loc='right'))
4144+
assert_equal('aardvark', ax.get_title())
4145+
4146+
assert_raises(ValueError, ax.get_title, loc='foo')
4147+
assert_raises(ValueError, ax.set_title, 'fail', loc='foo')
4148+
41364149

41374150
if __name__ == '__main__':
41384151
import nose

0 commit comments

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