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

Function test_date_empty

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

Source from the content-addressed store, hash-verified

90
91
92def test_date_empty():
93 # make sure we do the right thing when told to plot dates even
94 # if no date data has been presented, cf
95 # http://sourceforge.net/tracker/?func=detail&aid=2850075&group_id=80706&atid=560720
96 fig, ax = plt.subplots()
97 ax.xaxis_date()
98 fig.draw_without_rendering()
99 np.testing.assert_allclose(ax.get_xlim(),
100 [mdates.date2num(np.datetime64('1970-01-01')),
101 mdates.date2num(np.datetime64('1970-01-02'))])
102
103 mdates._reset_epoch_test_example()
104 mdates.set_epoch('0000-12-31')
105 fig, ax = plt.subplots()
106 ax.xaxis_date()
107 fig.draw_without_rendering()
108 np.testing.assert_allclose(ax.get_xlim(),
109 [mdates.date2num(np.datetime64('1970-01-01')),
110 mdates.date2num(np.datetime64('1970-01-02'))])
111 mdates._reset_epoch_test_example()
112
113
114def test_date_not_empty():

Callers

nothing calls this directly

Calls 3

subplotsMethod · 0.45
get_xlimMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…