Skip to content

Commit ab1e1cb

Browse files
committed
Add test_step to test_datetime.py
1 parent 4eae3e4 commit ab1e1cb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/matplotlib/tests/test_datetime.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,11 +336,15 @@ def test_stem(self):
336336
fig, ax = plt.subplots()
337337
ax.stem(...)
338338

339-
@pytest.mark.xfail(reason="Test for step not written yet")
340339
@mpl.style.context("default")
341340
def test_step(self):
342-
fig, ax = plt.subplots()
343-
ax.step(...)
341+
mpl.rcParams["date.converter"] = "concise"
342+
N = 6
343+
fig, (ax1, ax2, ax3) = plt.subplots(3, 1, layout='constrained')
344+
x = np.array([datetime.datetime(2023, 9, n) for n in range(1, N)])
345+
ax1.step(x, range(1, N))
346+
ax2.step(range(1, N), x)
347+
ax3.step(x, x)
344348

345349
@pytest.mark.xfail(reason="Test for streamplot not written yet")
346350
@mpl.style.context("default")

0 commit comments

Comments
 (0)