Skip to content

Commit 2808618

Browse files
committed
Add test for timedelta --> ordinalf conversion
1 parent 8906f29 commit 2808618

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/matplotlib/tests/test_dates.py

+7
Original file line numberDiff line numberDiff line change
@@ -457,3 +457,10 @@ def test_DayLocator():
457457
def test_tz_utc():
458458
dt = datetime.datetime(1970, 1, 1, tzinfo=mdates.UTC)
459459
dt.tzname()
460+
461+
462+
def test_timedelta_ordinalf():
463+
# Check that timedeltas can be converted to ordinalfs
464+
dt = datetime.timedelta(seconds=60)
465+
ordinalf = mdates._to_ordinalf(dt)
466+
assert ordinalf == 1 / (24 * 60)

0 commit comments

Comments
 (0)