8000 Merge pull request #27428 from avramid9/test_broken_barh · matplotlib/matplotlib@2ccc703 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2ccc703

Browse files
authored
Merge pull request #27428 from avramid9/test_broken_barh
Added test for broken_barh to test_datetime.py
2 parents 580cda5 + cad6d11 commit 2ccc703

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/matplotlib/tests/test_datetime.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,18 @@ def test_boxplot(self):
224224
fig, ax = plt.subplots()
225225
ax.boxplot(...)
226226

227-
@pytest.mark.xfail(reason="Test for broken_barh not written yet")
228227
@mpl.style.context("default")
229228
def test_broken_barh(self):
229+
# Horizontal bar plot with gaps
230+
mpl.rcParams["date.converter"] = 'concise'
230231
fig, ax = plt.subplots()
231-
ax.broken_barh(...)
232+
233+
ax.broken_barh([(datetime.datetime(2023, 1, 4), datetime.timedelta(days=2)),
234+
(datetime.datetime(2023, 1, 8), datetime.timedelta(days=3))],
235+
(10, 9), facecolors='tab:blue')
236+
ax.broken_barh([(datetime.datetime(2023, 1, 2), datetime.timedelta(days=1)),
237+
(datetime.datetime(2023, 1, 4), datetime.timedelta(days=4))],
238+
(20, 9), facecolors=('tab:red'))
232239

233240
@pytest.mark.xfail(reason="Test for bxp not written yet")
234241
@mpl.style.context("default")

0 commit comments

Comments
 (0)
0