MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_RRuleLocator_close_minmax

Function test_RRuleLocator_close_minmax

lib/matplotlib/tests/test_dates.py:261–270  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

259
260
261def test_RRuleLocator_close_minmax():
262 # if d1 and d2 are very close together, rrule cannot create
263 # reasonable tick intervals; ensure that this is handled properly
264 rrule = mdates.rrulewrapper(dateutil.rrule.SECONDLY, interval=5)
265 loc = mdates.RRuleLocator(rrule)
266 d1 = datetime.datetime(year=2020, month=1, day=1)
267 d2 = datetime.datetime(year=2020, month=1, day=1, microsecond=1)
268 expected = ['2020-01-01 00:00:00+00:00',
269 '2020-01-01 00:00:00.000001+00:00']
270 assert list(map(str, mdates.num2date(loc.tick_values(d1, d2)))) == expected
271
272
273@image_comparison(['DateFormatter_fractionalSeconds.png'], style='mpl20')

Callers

nothing calls this directly

Calls 1

tick_valuesMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…