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

Lines changed: 7 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy