diff --git a/lib/matplotlib/tests/test_datetime.py b/lib/matplotlib/tests/test_datetime.py index f42e0a0d04d8..6ea29c78f506 100644 --- a/lib/matplotlib/tests/test_datetime.py +++ b/lib/matplotlib/tests/test_datetime.py @@ -343,11 +343,24 @@ def test_stem(self): fig, ax = plt.subplots() ax.stem(...) - @pytest.mark.xfail(reason="Test for step not written yet") @mpl.style.context("default") def test_step(self): - fig, ax = plt.subplots() - ax.step(...) + mpl.rcParams["date.converter"] = "concise" + limit = 5 + fig, (ax1, ax2, ax3, ax4) = plt.subplots(4, 1, layout="constrained") + + start_date = datetime.date(2023, 1, 1) + x_date = [start_date + datetime.timedelta(days=i) for i in range(1, limit)] + y_date = [start_date + datetime.timedelta(days=i) for i in range(1, limit)] + x_ranges = np.array(range(1, limit)) + y_ranges = np.array(range(1, limit)) + + ax1.step(x_ranges, y_date, 'g', where='pre', label='pre') + ax2.step(x_date, y_ranges, 'b', where='mid', label='mid') + ax3.step(x_date, y_date, 'r', where='post', label='post') + ax4.step("date", "signal", + data={"date": x_date, "signal": y_ranges}, + where='mid', label='mid') @pytest.mark.xfail(reason="Test for streamplot not written yet") @mpl.style.context("default")