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

Skip to content

Commit de6919c

Browse files
committed
TST: implement plot smoke test
1 parent 6b870e7 commit de6919c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

lib/matplotlib/tests/test_datetime.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import datetime
2+
import numpy as np
3+
14
import pytest
25

36
import matplotlib.pyplot as plt
@@ -239,11 +242,15 @@ def test_phase_spectrum(self):
239242
fig, ax = plt.subplots()
240243
ax.phase_spectrum(...)
241244

242-
@pytest.mark.xfail(reason="Test for plot not written yet")
243245
@mpl.style.context("default")
244246
def test_plot(self):
245-
fig, ax = plt.subplots()
246-
ax.plot(...)
247+
mpl.rcParams["date.converter"] = 'concise'
248+
N = 6
249+
fig, (ax1, ax2, ax3) = plt.subplots(3, 1, layout='constrained')
250+
x = np.array([datetime.datetime(2023, 9, n) for n in range(1, N)])
251+
ax1.plot(x, range(1, N))
252+
ax2.plot(range(1, N), x)
253+
ax3.plot(x, x)
247254

248255
@pytest.mark.xfail(reason="Test for plot_date not written yet")
249256
@mpl.style.context("default")

0 commit comments

Comments
 (0)