Skip to content

Commit c7851e3

Browse files
committed
Adjusts tdi test draw calls to try to fix CI issue.
1 parent 7d28842 commit c7851e3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pandas/tests/plotting/test_datetimelike.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -1273,7 +1273,6 @@ def test_plot_outofbounds_datetime(self):
12731273
self.plt.plot(values)
12741274

12751275
def test_format_timedelta_ticks_narrow(self):
1276-
import matplotlib.pyplot as plt
12771276

12781277
expected_labels = [
12791278
'00:00:00.00000000{:d}'.format(i)
@@ -1282,16 +1281,16 @@ def test_format_timedelta_ticks_narrow(self):
12821281
rng = timedelta_range('0', periods=10, freq='ns')
12831282
df = DataFrame(np.random.randn(len(rng), 3), rng)
12841283
ax = df.plot(fontsize=2)
1285-
plt.gcf().autofmt_xdate()
1286-
ax.get_figure().canvas.draw_idle()
1284+
fig = ax.get_figure()
1285+
fig.autofmt_xdate()
1286+
fig.canvas.draw()
12871287
labels = ax.get_xticklabels()
12881288
self.assertEqual(len(labels), len(expected_labels))
12891289
for l, l_expected in zip(labels, expected_labels):
12901290
self.assertEqual(l.get_text(), l_expected)
12911291
self.assertEqual(l.get_rotation(), 30)
12921292

12931293
def test_format_timedelta_ticks_wide(self):
1294-
import matplotlib.pyplot as plt
12951294

12961295
expected_labels = [
12971296
'00:00:00',
@@ -1308,8 +1307,9 @@ def test_format_timedelta_ticks_wide(self):
13081307
rng = timedelta_range('0', periods=10, freq='1 d')
13091308
df = DataFrame(np.random.randn(len(rng), 3), rng)
13101309
ax = df.plot(fontsize=2)
1311-
plt.gcf().autofmt_xdate()
1312-
ax.get_figure().canvas.draw_idle()
1310+
fig = ax.get_figure()
1311+
fig.autofmt_xdate()
1312+
fig.canvas.draw()
13131313
labels = ax.get_xticklabels()
13141314
self.assertEqual(len(labels), len(expected_labels))
13151315
for l, l_expected in zip(labels, expected_labels):

0 commit comments

Comments
 (0)