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

Skip to content

Added test for broken_barh to test_datetime.py #27428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions lib/matplotlib/tests/test_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,18 @@ def test_boxplot(self):
fig, ax = plt.subplots()
ax.boxplot(...)

@pytest.mark.xfail(reason="Test for broken_barh not written yet")
@mpl.style.context("default")
def test_broken_barh(self):
# Horizontal bar plot with gaps
mpl.rcParams["date.converter"] = 'concise'
fig, ax = plt.subplots()
ax.broken_barh(...)

ax.broken_barh([(datetime.datetime(2023, 1, 4), datetime.timedelta(days=2)),
(datetime.datetime(2023, 1, 8), datetime.timedelta(days=3))],
(10, 9), facecolors='tab:blue')
ax.broken_barh([(datetime.datetime(2023, 1, 2), datetime.timedelta(days=1)),
(datetime.datetime(2023, 1, 4), datetime.timedelta(days=4))],
(20, 9), facecolors=('tab:red'))

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