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

Skip to content

Commit a2a8dc2

Browse files
author
LindyBalboa
committed
Add tests for dates.DayLocator
1 parent b5c9aa4 commit a2a8dc2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/matplotlib/tests/test_dates.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,6 @@ def tz_convert(dt_list, tzinfo):
442442

443443
_test_date2num_dst(date_range, tz_convert)
444444

445-
446445
def test_date2num_dst_pandas():
447446
# Test for github issue #3896, but in date2num around DST transitions
448447
# with a timezone-aware pandas date_range object.
@@ -456,6 +455,13 @@ def tz_convert(*args):
456455

457456
_test_date2num_dst(pd.date_range, tz_convert)
458457

458+
def test_DayLocator():
459+
assert_raises(ValueError, mdates.DayLocator, interval=-1)
460+
assert_raises(ValueError, mdates.DayLocator, interval=-1.5)
461+
assert_raises(ValueError, mdates.DayLocator, interval=0)
462+
assert_raises(ValueError, mdates.DayLocator, interval=1.3)
463+
mdates.DayLocator(interval=1.0)
464+
459465

460466
if __name__ == '__main__':
461467
import nose

0 commit comments

Comments
 (0)