Skip to content

Commit 3e8129b

Browse files
committed
TST: Add test of broken_barh
1 parent 52d6a1c commit 3e8129b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/matplotlib/tests/test_axes.py

+9
Original file line numberDiff line numberDiff line change
@@ -5374,6 +5374,15 @@ def test_broken_barh_empty():
53745374
ax.broken_barh([], (.1, .5))
53755375

53765376

5377+
def test_broken_barh_timedelta():
5378+
""" Check that timedelta works as x, dx pair for this method """
5379+
fig, ax = plt.subplots()
5380+
pp = ax.broken_barh([(datetime.datetime(2018, 11, 9, 0, 0, 0),
5381+
datetime.timedelta(hours=1))], [1, 2])
5382+
assert pp.get_paths()[0].vertices[0, 0] == 737007.0
5383+
assert pp.get_paths()[0].vertices[2, 0] == 737007.0 + 1 / 24
5384+
5385+
53775386
def test_pandas_pcolormesh(pd):
53785387
time = pd.date_range('2000-01-01', periods=10)
53795388
depth = np.arange(20)

0 commit comments

Comments
 (0)