Skip to content

Commit 5448d57

Browse files
committed
Add additional test case to improve coverage.
1 parent a2b7c78 commit 5448d57

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7773,6 +7773,13 @@ def test_bar_label_fmt(fmt):
77737773
assert labels[1].get_text() == '-4.00'
77747774

77757775

7776+
def test_bar_label_fmt_error():
7777+
ax = plt.gca()
7778+
rects = ax.bar([1, 2], [3, -4])
7779+
with pytest.raises(TypeError, match='str or callable'):
7780+
_ = ax.bar_label(rects, fmt=10)
7781+
7782+
77767783
def test_bar_label_labels():
77777784
ax = plt.gca()
77787785
rects = ax.bar([1, 2], [3, -4])

0 commit comments

Comments
 (0)